Fix make protected method not visible
This commit is contained in:
parent
8bb8d846ad
commit
4926ac1e24
@ -72,6 +72,7 @@ class DolibarrApi
|
||||
//$this->r->setSupportedFormats('jsonFormat');
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Check and convert a string depending on its type/name.
|
||||
*
|
||||
@ -82,8 +83,9 @@ class DolibarrApi
|
||||
* @param stdClass $object Object
|
||||
* @return string Value cleaned
|
||||
*/
|
||||
protected function checkValForAPI($field, $value, $object)
|
||||
protected function _checkValForAPI($field, $value, $object)
|
||||
{
|
||||
// phpcs:enable
|
||||
// TODO Use type detected in $object->fields
|
||||
if (in_array($field, array('note', 'note_private', 'note_public', 'desc', 'description'))) {
|
||||
return checkVal($value, 'restricthtml');
|
||||
|
||||
@ -217,7 +217,7 @@ class AgendaEvents extends DolibarrApi
|
||||
$result = $this->_validate($request_data);
|
||||
|
||||
foreach ($request_data as $field => $value) {
|
||||
$this->actioncomm->$field = $this->checkValForAPI($field, $value, $this->actioncomm);
|
||||
$this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
|
||||
}
|
||||
/*if (isset($request_data["lines"])) {
|
||||
$lines = array();
|
||||
@ -270,7 +270,7 @@ class AgendaEvents extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->actioncomm->$field = $this->checkValForAPI($field, $value, $this->actioncomm);
|
||||
$this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
|
||||
}
|
||||
|
||||
if ($this->actioncomm->update(DolibarrApiAccess::$user, 1) > 0) {
|
||||
|
||||
@ -157,7 +157,7 @@ class BankAccounts extends DolibarrApi
|
||||
|
||||
$account = new Account($this->db);
|
||||
foreach ($request_data as $field => $value) {
|
||||
$account->$field = $this->checkValForAPI($field, $value, $account);
|
||||
$account->$field = $this->_checkValForAPI($field, $value, $account);
|
||||
}
|
||||
// Date of the initial balance (required to create an account).
|
||||
$account->date_solde = time();
|
||||
@ -332,7 +332,7 @@ class BankAccounts extends DolibarrApi
|
||||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
$account->$field = $this->checkValForAPI($field, $value, $account);
|
||||
$account->$field = $this->_checkValForAPI($field, $value, $account);
|
||||
}
|
||||
|
||||
if ($account->update(DolibarrApiAccess::$user) > 0) {
|
||||
|
||||
@ -213,7 +213,7 @@ class MyModuleApi extends DolibarrApi
|
||||
$result = $this->_validate($request_data);
|
||||
|
||||
foreach ($request_data as $field => $value) {
|
||||
$this->myobject->$field = $this->checkValForAPI($field, $value, $this->myobject);
|
||||
$this->myobject->$field = $this->_checkValForAPI($field, $value, $this->myobject);
|
||||
}
|
||||
|
||||
// Clean data
|
||||
@ -255,7 +255,7 @@ class MyModuleApi extends DolibarrApi
|
||||
if ($field == 'id') {
|
||||
continue;
|
||||
}
|
||||
$this->myobject->$field = $this->checkValForAPI($field, $value, $this->myobject);
|
||||
$this->myobject->$field = $this->_checkValForAPI($field, $value, $this->myobject);
|
||||
}
|
||||
|
||||
// Clean data
|
||||
|
||||
Loading…
Reference in New Issue
Block a user