|
dolibarr
13.0.2
|
Class for API REST v1. More...
Inheritance diagram for DolibarrApi:Public Member Functions | |
| __construct ($db, $cachedir= '', $refreshCache=false) | |
| Constructor. More... | |
Protected Member Functions | |
| _cleanObjectDatas ($object) | |
| Executed method when API is called without parameter. More... | |
| _checkFilters ($sqlfilters) | |
| Return if a $sqlfilters parameter is valid. More... | |
Static Protected Member Functions | |
| static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid') |
| Check user access to a resource. More... | |
| static | _forge_criteria_callback ($matches) |
| Function to forge a SQL criteria. 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.
References db.
|
staticprotected |
Check user access to a resource.
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) |
| RestException |
Definition at line 252 of file api.class.php.
References checkUserAccessToObject().
Referenced by Invoices\_fetch(), Proposals\_fetch(), Orders\_fetch(), Products\_fetch(), Thirdparties\_fetch(), Contracts\activateLine(), Contacts\addCategory(), Thirdparties\addCategory(), Invoices\addContact(), SupplierInvoices\addPayment(), Invoices\addPayment(), Invoices\addPaymentDistributed(), Products\addPurchasePrice(), Products\addSubproducts(), Thirdparties\addSupplierCategory(), Tasks\addTimeSpent(), Contracts\close(), Proposals\close(), Orders\close(), Interventions\closeFichinter(), Contacts\createUser(), MembersTypes\delete(), Warehouses\delete(), Boms\delete(), Donations\delete(), Mos\delete(), Categories\delete(), MyModuleApi\delete(), SupplierOrders\delete(), SupplierInvoices\delete(), AgendaEvents\delete(), Interventions\delete(), ZapierApi\delete(), Contacts\delete(), Members\delete(), Products\delete(), Tickets\delete(), ExpenseReports\delete(), Shipments\delete(), Projects\delete(), Tasks\delete(), Thirdparties\delete(), Contracts\delete(), Users\delete(), Proposals\delete(), Invoices\delete(), Orders\delete(), Contacts\deleteCategory(), Thirdparties\deleteCategory(), Invoices\deleteContact(), Proposals\deleteContact(), Orders\deleteContact(), Shipments\deleteLine(), Orders\deleteLine(), Proposals\deleteLine(), Contracts\deleteLine(), Invoices\deleteLine(), SupplierInvoices\deleteLine(), Products\deletePurchasePrice(), Thirdparties\deleteSupplierCategory(), Products\delSubproducts(), MembersTypes\get(), Members\get(), Warehouses\get(), AgendaEvents\get(), Donations\get(), SupplierOrders\get(), Mos\get(), Boms\get(), Supplierproposals\get(), Shipments\get(), ExpenseReports\get(), SupplierInvoices\get(), Projects\get(), Tasks\get(), Contracts\get(), MyModuleApi\get(), Contacts\get(), ZapierApi\get(), Interventions\get(), Categories\get(), Users\get(), Contacts\getByEmail(), Users\getByEmail(), Users\getByLogin(), Members\getByThirdparty(), Members\getByThirdpartyBarcode(), Members\getByThirdpartyEmail(), Tickets\getCommon(), Thirdparties\getCompanyBankAccount(), Orders\getContacts(), Invoices\getDiscount(), Thirdparties\getFixedAmountDiscounts(), Users\getInfo(), Thirdparties\getInvoicesQualifiedForCreditNote(), Thirdparties\getInvoicesQualifiedForReplacement(), Contracts\getLines(), Projects\getLines(), Proposals\getLines(), Orders\getLines(), Invoices\getLines(), SupplierInvoices\getLines(), Categories\getObjects(), Thirdparties\getOutStandingInvoices(), Thirdparties\getOutStandingOrder(), Thirdparties\getOutStandingProposals(), SupplierInvoices\getPayments(), Invoices\getPayments(), Products\getPurchasePrices(), Projects\getRoles(), Tasks\getRoles(), Thirdparties\getSalesRepresentatives(), Thirdparties\getSocieteAccounts(), Products\getSubproducts(), Invoices\markAsCreditAvailable(), Thirdparties\merge(), Invoices\postContact(), Proposals\postContact(), Orders\postContact(), Interventions\postLine(), Contracts\postLine(), Proposals\postLine(), Orders\postLine(), SupplierInvoices\postLine(), Invoices\postLine(), MembersTypes\put(), Warehouses\put(), Boms\put(), Donations\put(), Mos\put(), MyModuleApi\put(), Categories\put(), AgendaEvents\put(), SupplierInvoices\put(), SupplierOrders\put(), Thirdparties\put(), Products\put(), Members\put(), Contacts\put(), Users\put(), Tickets\put(), ExpenseReports\put(), Shipments\put(), Tasks\put(), Projects\put(), Contracts\put(), Proposals\put(), Invoices\put(), Orders\put(), Contracts\putLine(), Proposals\putLine(), Orders\putLine(), Invoices\putLine(), SupplierInvoices\putLine(), Users\setGroup(), Orders\setinvoiced(), Proposals\setinvoiced(), Thirdparties\setThirdpartyPriceLevel(), Proposals\settodraft(), Invoices\settodraft(), Orders\settodraft(), Invoices\settopaid(), Invoices\settounpaid(), Contracts\unactivateLine(), Invoices\useCreditNote(), Invoices\useDiscount(), Donations\validate(), SupplierOrders\validate(), SupplierInvoices\validate(), Interventions\validate(), Shipments\validate(), Projects\validate(), Contracts\validate(), Orders\validate(), Proposals\validate(), and Invoices\validate().
|
protected |
Return if a $sqlfilters parameter is valid.
| string | $sqlfilters | sqlfilter string |
Definition at line 278 of file api.class.php.
References dol_syslog().
Referenced by Products\getAttributes(), Setup\getAvailability(), BankAccounts\getLines(), Setup\getListOfCivilities(), Setup\getListOfContactTypes(), Setup\getListOfCountries(), Setup\getListOfCurrencies(), Setup\getListOfEventTypes(), Setup\getListOfExpenseReportsTypes(), Setup\getListOfExtrafields(), Setup\getListOfMeasuringUnits(), Setup\getListOfShipmentMethods(), Setup\getListOfsocialNetworks(), Setup\getListOfStates(), Setup\getListOfTowns(), Setup\getOrderingMethods(), Setup\getOrderingOrigins(), Setup\getPaymentTerms(), Setup\getPaymentTypes(), Setup\getShippingModes(), Products\getSupplierProducts(), Setup\getTicketsCategories(), Setup\getTicketsSeverities(), Setup\getTicketsTypes(), BankAccounts\index(), Users\index(), Subscriptions\index(), MembersTypes\index(), Warehouses\index(), StockMovements\index(), Mos\index(), Supplierproposals\index(), Boms\index(), ExpenseReports\index(), SupplierOrders\index(), SupplierInvoices\index(), Donations\index(), Shipments\index(), Projects\index(), Contracts\index(), MyModuleApi\index(), AgendaEvents\index(), Interventions\index(), Tasks\index(), Categories\index(), Thirdparties\index(), ZapierApi\index(), Proposals\index(), Orders\index(), Invoices\index(), Products\index(), Contacts\index(), Members\index(), Tickets\index(), and Users\listGroups().
|
protected |
Executed method when API is called without parameter.
Display a short message an return a http code 200
| Object | $object | Object to clean |
Definition at line 98 of file api.class.php.
Referenced by Subscriptions\get(), and Subscriptions\index().
|
staticprotected |
Function to forge a SQL criteria.
| array | $matches | Array of found string by regex search. Example: "t.ref:like:'SO-%'" or "t.date_creation:<:'20160101'" or "t.nature:is:NULL" |
Definition at line 310 of file api.class.php.