|
dolibarr
13.0.2
|
Inheritance diagram for Categories:
Collaboration diagram for Categories:Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id, $include_childs=false) | |
| Get properties of a category object. More... | |
| index ($sortfield="t.rowid", $sortorder= 'ASC', $limit=100, $page=0, $type= '', $sqlfilters= '') | |
| List categories. More... | |
| post ($request_data=null) | |
| Create category object. More... | |
| put ($id, $request_data=null) | |
| Update category. More... | |
| delete ($id) | |
| Delete category. More... | |
| getListForObject ($id, $type, $sortfield="s.rowid", $sortorder= 'ASC', $limit=0, $page=0) | |
| List categories of an object. More... | |
| linkObjectById ($id, $type, $object_id) | |
| Link an object to a category by id. More... | |
| linkObjectByRef ($id, $type, $object_ref) | |
| Link an object to a category by ref. More... | |
| unlinkObjectById ($id, $type, $object_id) | |
| Unlink an object from a category by id. More... | |
| unlinkObjectByRef ($id, $type, $object_ref) | |
| Unlink an object from a category by ref. More... | |
| getObjects ($id, $type, $onlyids=0) | |
| Get the list of objects in a category. More... | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir= '', $refreshCache=false) | |
| Constructor. More... | |
Protected Member Functions | |
| _cleanObjectDatas ($object) | |
| Clean sensible object datas. More... | |
Protected Member Functions inherited from DolibarrApi | |
| _cleanObjectDatas ($object) | |
| Executed method when API is called without parameter. More... | |
| _checkFilters ($sqlfilters) | |
| Return if a $sqlfilters parameter is valid. More... | |
Private Member Functions | |
| _validate ($data) | |
| Validate fields before create or update object. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from DolibarrApi | |
| 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... | |
Definition at line 36 of file api_categories.class.php.
|
protected |
Clean sensible object datas.
| Categorie | $object | Object to clean |
Definition at line 663 of file api_categories.class.php.
|
private |
Validate fields before create or update object.
| array | null | $data | Data to validate |
| RestException |
Definition at line 720 of file api_categories.class.php.
Referenced by post().
| Categories::delete | ( | $id | ) |
Delete category.
| int | $id | Category ID |
Definition at line 258 of file api_categories.class.php.
References DolibarrApi\_checkAccessToResource().
| Categories::get | ( | $id, | |
$include_childs = false |
|||
| ) |
Get properties of a category object.
Return an array with category informations
| int | $id | ID of category |
| bool | $include_childs | Include child categories list (true or false) |
| RestException |
Definition at line 86 of file api_categories.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Categories::getListForObject | ( | $id, | |
| $type, | |||
$sortfield = "s.rowid", |
|||
$sortorder = 'ASC', |
|||
$limit = 0, |
|||
$page = 0 |
|||
| ) |
List categories of an object.
Get the list of categories linked to an object
| int | $id | Object ID |
| string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'project') |
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| RestException | GET /object/{type}/{id} |
Definition at line 301 of file api_categories.class.php.
| Categories::getObjects | ( | $id, | |
| $type, | |||
$onlyids = 0 |
|||
| ) |
Get the list of objects in a category.
| int | $id | ID of category |
| string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact', 'project') |
| int | $onlyids | Return only ids of objects (consume less memory) |
GET {id}/objects
Definition at line 742 of file api_categories.class.php.
References DolibarrApi\_checkAccessToResource(), and dol_syslog().
| Categories::index | ( | $sortfield = "t.rowid", |
|
$sortorder = 'ASC', |
|||
$limit = 100, |
|||
$page = 0, |
|||
$type = '', |
|||
$sqlfilters = '' |
|||
| ) |
List categories.
Get a list of categories
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact') |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" |
| RestException |
Definition at line 130 of file api_categories.class.php.
References DolibarrApi\_checkFilters(), _cleanObjectDatas(), and db.
| Categories::linkObjectById | ( | $id, | |
| $type, | |||
| $object_id | |||
| ) |
Link an object to a category by id.
| int | $id | ID of category |
| string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact') |
| int | $object_id | ID of object |
| RestException | POST {id}/objects/{type}/{object_id} |
Definition at line 351 of file api_categories.class.php.
References db.
| Categories::linkObjectByRef | ( | $id, | |
| $type, | |||
| $object_ref | |||
| ) |
Link an object to a category by ref.
| int | $id | ID of category |
| string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact') |
| string | $object_ref | Reference of object |
| RestException | POST {id}/objects/{type}/ref/{object_ref} |
Definition at line 431 of file api_categories.class.php.
References db.
| Categories::post | ( | $request_data = null | ) |
Create category object.
| array | $request_data | Request data |
Definition at line 200 of file api_categories.class.php.
References _validate().
| Categories::put | ( | $id, | |
$request_data = null |
|||
| ) |
Update category.
| int | $id | Id of category to update |
| array | $request_data | Datas |
Definition at line 225 of file api_categories.class.php.
References DolibarrApi\_checkAccessToResource().
| Categories::unlinkObjectById | ( | $id, | |
| $type, | |||
| $object_id | |||
| ) |
Unlink an object from a category by id.
| int | $id | ID of category |
| string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact') |
| int | $object_id | ID of the object |
| RestException | DELETE {id}/objects/{type}/{object_id} |
Definition at line 511 of file api_categories.class.php.
References db.
| Categories::unlinkObjectByRef | ( | $id, | |
| $type, | |||
| $object_ref | |||
| ) |
Unlink an object from a category by ref.
| int | $id | ID of category |
| string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact') |
| string | $object_ref | Reference of the object |
| RestException | DELETE {id}/objects/{type}/ref/{object_ref} |
Definition at line 589 of file api_categories.class.php.
References db.