dolibarr
19.0.0-dev
|
Class for API REST v1. More...
Public Member Functions | |
__construct ($db, $cachedir='', $refreshCache=false) | |
Constructor. More... | |
Protected Member Functions | |
_checkValForAPI ($field, $value, $object) | |
Check and convert a string depending on its type/name. More... | |
_cleanObjectDatas ($object) | |
Clean sensible object datas. More... | |
_checkFilters ($sqlfilters, &$error='') | |
Return if a $sqlfilters parameter is valid Function no more used. More... | |
Static Protected Member Functions | |
static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') |
Check access by user to a given resource. More... | |
static | _forge_criteria_callback ($matches) |
Function to forge a SQL criteria from a Generic filter string. More... | |
Class for API REST v1.
Definition at line 30 of file api.class.php.
DolibarrApi::__construct | ( | $db, | |
$cachedir = '' , |
|||
$refreshCache = false |
|||
) |
Constructor.
DoliDb | $db | Database handler |
string | $cachedir | Cache dir |
boolean | $refreshCache | Update cache |
Definition at line 50 of file api.class.php.
|
staticprotected |
Check access by user to a given resource.
string | $resource | element to check |
int | $resource_id | Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional). |
string | $dbtablename | 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity. Not used if objectid is null (optional) |
string | $feature2 | Feature to check, second level of permission (optional). Can be or check with 'level1|level2'. |
string | $dbt_keyfield | Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional) |
string | $dbt_select | Field name for select if not rowid. Not used if objectid is null (optional) |
Definition at line 282 of file api.class.php.
|
protected |
Return if a $sqlfilters parameter is valid Function no more used.
Kept for backward compatibility with old APIs of modules
string | $sqlfilters | sqlfilter string |
string | $error | Error message |
Definition at line 310 of file api.class.php.
|
protected |
Check and convert a string depending on its type/name.
Display a short message an return a http code 200
string | $field | Field name |
string | $value | Value to check/clean |
Object | $object | Object |
Definition at line 86 of file api.class.php.
|
protected |
Clean sensible object datas.
Object | $object | Object to clean |
Reimplemented in Products, Thirdparties, Invoices, Orders, Proposals, Setup, SupplierInvoices, SupplierOrders, Tasks, Shipments, Receptions, Categories, Users, Contracts, Mos, Recruitment, Projects, Contacts, ExpenseReports, Tickets, Boms, Interventions, Members, BankAccounts, KnowledgeManagement, AgendaEvents, Zapier, MyModuleApi, Donations, MultiCurrencies, PartnershipApi, StockMovements, MembersTypes, Warehouses, and SupplierProposals.
Definition at line 104 of file api.class.php.
|
staticprotected |
Function to forge a SQL criteria from a Generic filter string.
Function no more used. Kept for backward compatibility with old APIs of modules
array | $matches | Array of found string by regex search. Each entry is 1 and only 1 criteria. Example: "t.ref:like:'SO-%'", "t.date_creation:<:'20160101'", "t.date_creation:<:'2016-01-01 12:30:00'", "t.nature:is:NULL", "t.field2:isnot:NULL" |
Definition at line 328 of file api.class.php.
References dolForgeCriteriaCallback().