Fix cleandata method of modulebuilder template of AAPI
This commit is contained in:
parent
e2e09f8534
commit
e6acacee4b
@ -170,7 +170,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$myobject_static = new MyObject($db);
|
$myobject_static = new MyObject($db);
|
||||||
if($myobject_static->fetch($obj->rowid)) {
|
if($myobject_static->fetch($obj->rowid)) {
|
||||||
$obj_ret[] = parent::_cleanObjectDatas($myobject_static);
|
$obj_ret[] = $this->_cleanObjectDatas($myobject_static);
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -279,6 +279,27 @@ class MyModuleApi extends DolibarrApi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean sensible object datas
|
||||||
|
*
|
||||||
|
* @param object $object Object to clean
|
||||||
|
* @return array Array of cleaned object properties
|
||||||
|
*/
|
||||||
|
function _cleanObjectDatas($object)
|
||||||
|
{
|
||||||
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
/*unset($object->note);
|
||||||
|
unset($object->address);
|
||||||
|
unset($object->barcode_type);
|
||||||
|
unset($object->barcode_type_code);
|
||||||
|
unset($object->barcode_type_label);
|
||||||
|
unset($object->barcode_type_coder);*/
|
||||||
|
|
||||||
|
return $object;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate fields before create or update object
|
* Validate fields before create or update object
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user