2
0
forked from Wavyzz/dolibarr

Add API class for orders

This commit is contained in:
jfefe
2015-05-05 03:44:46 +02:00
parent 0012cd8131
commit 289b847eb4
2 changed files with 341 additions and 1 deletions

View File

@@ -72,8 +72,24 @@ class DolibarrApi {
*/
protected function _cleanObjectDatas($object){
// Remove $db object property for object
unset($object->db);
// If object has lines, remove $db property
if(isset($object->lines) && count($object->lines) > 0) {
for($i=0; $i < count($object->lines); $i++) {
$this->_cleanObjectDatas($object->lines[$i]);
}
}
// If object has linked objects, remove $db property
if(isset($object->linkedObjects) && count($object->linkedObjects) > 0) {
foreach($object->linkedObjects as $type_object => $linked_object) {
foreach($linked_object as $object2clean) {
$this->_cleanObjectDatas($object2clean);
}
}
}
return $object;
}