|
| __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...
|
|
| __construct ($db, $cachedir='', $refreshCache=false) |
| Constructor. More...
|
|
Definition at line 36 of file api_categories.class.php.
◆ _cleanObjectDatas()
Categories::_cleanObjectDatas |
( |
|
$object | ) |
|
|
protected |
◆ _validate()
Categories::_validate |
( |
|
$data | ) |
|
|
private |
◆ delete()
Categories::delete |
( |
|
$id | ) |
|
◆ get()
Categories::get |
( |
|
$id, |
|
|
|
$include_childs = false |
|
) |
| |
Get properties of a category object.
Return an array with category informations
- Parameters
-
int | $id | ID of category |
bool | $include_childs | Include child categories list (true or false) |
- Returns
- array|mixed data without useless information
- Exceptions
-
Definition at line 89 of file api_categories.class.php.
◆ getListForObject()
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
- Parameters
-
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 |
- Returns
- array Array of category objects
- Exceptions
-
RestException | @url GET /object/{type}/{id} |
Definition at line 300 of file api_categories.class.php.
◆ getObjects()
Categories::getObjects |
( |
|
$id, |
|
|
|
$type, |
|
|
|
$onlyids = 0 |
|
) |
| |
Get the list of objects in a category.
- Parameters
-
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) |
- Returns
- mixed
@url GET {id}/objects
Definition at line 746 of file api_categories.class.php.
◆ index()
Categories::index |
( |
|
$sortfield = "t.rowid" , |
|
|
|
$sortorder = 'ASC' , |
|
|
|
$limit = 100 , |
|
|
|
$page = 0 , |
|
|
|
$type = '' , |
|
|
|
$sqlfilters = '' |
|
) |
| |
List categories.
Get a list of categories
- Parameters
-
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')" |
- Returns
- array Array of category objects
- Exceptions
-
Definition at line 133 of file api_categories.class.php.
◆ linkObjectById()
Categories::linkObjectById |
( |
|
$id, |
|
|
|
$type, |
|
|
|
$object_id |
|
) |
| |
Link an object to a category by id.
- Parameters
-
int | $id | ID of category |
string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact') |
int | $object_id | ID of object |
- Returns
- array
- Exceptions
-
RestException | @url POST {id}/objects/{type}/{object_id} |
Definition at line 353 of file api_categories.class.php.
◆ linkObjectByRef()
Categories::linkObjectByRef |
( |
|
$id, |
|
|
|
$type, |
|
|
|
$object_ref |
|
) |
| |
Link an object to a category by ref.
- Parameters
-
int | $id | ID of category |
string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact') |
string | $object_ref | Reference of object |
- Returns
- array
- Exceptions
-
RestException | @url POST {id}/objects/{type}/ref/{object_ref} |
Definition at line 433 of file api_categories.class.php.
◆ post()
Categories::post |
( |
|
$request_data = null | ) |
|
Create category object.
- Parameters
-
array | $request_data | Request data |
- Returns
- int ID of category
Definition at line 197 of file api_categories.class.php.
◆ put()
Categories::put |
( |
|
$id, |
|
|
|
$request_data = null |
|
) |
| |
Update category.
- Parameters
-
int | $id | Id of category to update |
array | $request_data | Datas |
- Returns
- int
Definition at line 222 of file api_categories.class.php.
◆ unlinkObjectById()
Categories::unlinkObjectById |
( |
|
$id, |
|
|
|
$type, |
|
|
|
$object_id |
|
) |
| |
Unlink an object from a category by id.
- Parameters
-
int | $id | ID of category |
string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact') |
int | $object_id | ID of the object |
- Returns
- array
- Exceptions
-
RestException | @url DELETE {id}/objects/{type}/{object_id} |
Definition at line 513 of file api_categories.class.php.
◆ unlinkObjectByRef()
Categories::unlinkObjectByRef |
( |
|
$id, |
|
|
|
$type, |
|
|
|
$object_ref |
|
) |
| |
Unlink an object from a category by ref.
- Parameters
-
int | $id | ID of category |
string | $type | Type of category ('member', 'customer', 'supplier', 'product', 'contact') |
string | $object_ref | Reference of the object |
- Returns
- array
- Exceptions
-
RestException | @url DELETE {id}/objects/{type}/ref/{object_ref} |
Definition at line 591 of file api_categories.class.php.
The documentation for this class was generated from the following file: