Clean code

This commit is contained in:
Laurent Destailleur 2022-10-22 00:08:10 +02:00
parent d9c2528b62
commit a2d9dd3388
3 changed files with 9 additions and 8 deletions

View File

@ -113,9 +113,8 @@ class DolibarrApi
unset($object->pass); unset($object->pass);
unset($object->pass_indatabase); unset($object->pass_indatabase);
// Remove linkedObjects. We should already have linkedObjectsIds that avoid huge responses // Remove linkedObjects. We should already have and keep only linkedObjectsIds that avoid huge responses
unset($object->linkedObjects); unset($object->linkedObjects);
unset($object->linkedObjectsFullLoaded);
//unset($object->lines[$i]->linked_objects); // This is the array to create linked object during create //unset($object->lines[$i]->linked_objects); // This is the array to create linked object during create
unset($object->fields); unset($object->fields);

View File

@ -2805,7 +2805,8 @@ class ContratLigne extends CommonObjectLine
public $table_element = 'contratdet'; public $table_element = 'contratdet';
/** /**
* @var string Name to use for 'features' parameter to check module permissions with restrictedArea() * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea().
* Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element.
*/ */
public $element_for_permission = 'contrat'; public $element_for_permission = 'contrat';

View File

@ -78,7 +78,7 @@ abstract class CommonObject
/** /**
* @var array To store error results of ->validateField() * @var array To store error results of ->validateField()
*/ */
public $validateFieldsErrors = array(); private $validateFieldsErrors = array();
/** /**
* @var string ID to identify managed object * @var string ID to identify managed object
@ -86,7 +86,8 @@ abstract class CommonObject
public $element; public $element;
/** /**
* @var string Name to use for 'features' parameter to check module permissions with restrictedArea(). Undefined means same value than $element. * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea().
* Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element.
*/ */
public $element_for_permission; public $element_for_permission;
@ -136,9 +137,9 @@ abstract class CommonObject
public $linkedObjects; public $linkedObjects;
/** /**
* @var boolean Array of boolean with object id as key and value as true if linkedObjects full loaded. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction. * @var boolean[] Array of boolean with object id as key and value as true if linkedObjects full loaded for object id. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction.
*/ */
public $linkedObjectsFullLoaded = array(); private $linkedObjectsFullLoaded = array();
/** /**
* @var CommonObject To store a cloned copy of object before to edit it and keep track of old properties * @var CommonObject To store a cloned copy of object before to edit it and keep track of old properties
@ -7831,7 +7832,7 @@ abstract class CommonObject
* get field error message * get field error message
* *
* @param string $fieldKey Key of attribute * @param string $fieldKey Key of attribute
* @return string * @return string Error message of validation ('' if no error)
*/ */
public function getFieldError($fieldKey) public function getFieldError($fieldKey)
{ {