mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-07 17:42:53 +01:00
Fix cleandata method of modulebuilder template of AAPI
This commit is contained in:
@@ -170,7 +170,7 @@ class MyModuleApi extends DolibarrApi
|
||||
$obj = $db->fetch_object($result);
|
||||
$myobject_static = new MyObject($db);
|
||||
if($myobject_static->fetch($obj->rowid)) {
|
||||
$obj_ret[] = parent::_cleanObjectDatas($myobject_static);
|
||||
$obj_ret[] = $this->_cleanObjectDatas($myobject_static);
|
||||
}
|
||||
$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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user