|
dolibarr 18.0.8
|


Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id, $includecount=0, $includeroles=0) | |
| Get properties of a contact object. | |
| getByEmail ($email, $includecount=0, $includeroles=0) | |
| Get properties of a contact object by Email. | |
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $thirdparty_ids='', $category=0, $sqlfilters='', $includecount=0, $includeroles=0) | |
| List contacts. | |
| post ($request_data=null) | |
| Create contact object. | |
| put ($id, $request_data=null) | |
| Update contact. | |
| delete ($id) | |
| Delete contact. | |
| createUser ($id, $request_data=null) | |
| Create an user account object from contact (external user) | |
| getCategories ($id, $sortfield="s.rowid", $sortorder='ASC', $limit=0, $page=0) | |
| Get categories for a contact. | |
| addCategory ($id, $category_id) | |
| Add a category to a contact. | |
| deleteCategory ($id, $category_id) | |
| Remove the link between a category and a contact. | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir='', $refreshCache=false) | |
| Constructor. | |
Protected Member Functions | |
| _cleanObjectDatas ($object) | |
| Clean sensible object datas. | |
Protected Member Functions inherited from DolibarrApi | |
| _checkValForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _checkFilters ($sqlfilters, &$error='') | |
| Return if a $sqlfilters parameter is valid Function no more used. | |
Private Member Functions | |
| _validate ($data) | |
| Validate fields before create or update object. | |
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 access by user to a given resource. | |
| static | _forge_criteria_callback ($matches) |
| Function to forge a SQL criteria from a Generic filter string. | |
Definition at line 31 of file api_contacts.class.php.
|
protected |
Clean sensible object datas.
| Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 560 of file api_contacts.class.php.
Referenced by addCategory(), deleteCategory(), get(), getByEmail(), and index().
|
private |
Validate fields before create or update object.
| array | null | $data | Data to validate |
| RestException |
Definition at line 585 of file api_contacts.class.php.
Referenced by post().
| Contacts::addCategory | ( | $id, | |
| $category_id ) |
Add a category to a contact.
@url POST {id}/categories/{category_id}
| int | $id | Id of contact |
| int | $category_id | Id of category |
| RestException | 401 Insufficient rights |
| RestException | 404 Category or contact not found |
Definition at line 485 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Contacts::createUser | ( | $id, | |
| $request_data = null ) |
Create an user account object from contact (external user)
| int | $id | Id of contact |
| array | $request_data | Request datas |
@url POST {id}/createUser
Definition at line 394 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource().
| Contacts::delete | ( | $id | ) |
Delete contact.
| int | $id | Contact ID |
Definition at line 358 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource().
| Contacts::deleteCategory | ( | $id, | |
| $category_id ) |
Remove the link between a category and a contact.
@url DELETE {id}/categories/{category_id}
| int | $id | Id of contact |
| int | $category_id | Id of category |
| RestException | 401 Insufficient rights |
| RestException | 404 Category or contact not found |
Definition at line 525 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Contacts::get | ( | $id, | |
| $includecount = 0, | |||
| $includeroles = 0 ) |
Get properties of a contact object.
Return an array with contact informations
| int | $id | ID of contact |
| int | $includecount | Count and return also number of elements the contact is used as a link for |
| int | $includeroles | Includes roles of the contact |
| RestException |
Definition at line 72 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Contacts::getByEmail | ( | $email, | |
| $includecount = 0, | |||
| $includeroles = 0 ) |
Get properties of a contact object by Email.
| string | Email of contact | |
| int | $includecount | Count and return also number of elements the contact is used as a link for |
| int | $includeroles | Includes roles of the contact |
@url GET email/{email}
| RestException | 401 Insufficient rights |
| RestException | 404 User or group not found |
Definition at line 120 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Contacts::getCategories | ( | $id, | |
| $sortfield = "s.rowid", | |||
| $sortorder = 'ASC', | |||
| $limit = 0, | |||
| $page = 0 ) |
Get categories for a contact.
| int | $id | ID of contact |
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
@url GET {id}/categories
Definition at line 451 of file api_contacts.class.php.
| Contacts::index | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $thirdparty_ids = '', | |||
| $category = 0, | |||
| $sqlfilters = '', | |||
| $includecount = 0, | |||
| $includeroles = 0 ) |
List contacts.
Get a list of contacts
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $thirdparty_ids | Thirdparty ids to filter contacts of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} |
| int | $category | Use this param to filter list by category |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" |
| int | $includecount | Count and return also number of elements the contact is used as a link for |
| int | $includeroles | Includes roles of the contact |
| RestException |
Definition at line 173 of file api_contacts.class.php.
References _cleanObjectDatas(), and forgeSQLFromUniversalSearchCriteria().
| Contacts::post | ( | $request_data = null | ) |
Create contact object.
| array | $request_data | Request datas |
Definition at line 284 of file api_contacts.class.php.
References _validate().
| Contacts::put | ( | $id, | |
| $request_data = null ) |
Update contact.
| int | $id | Id of contact to update |
| array | $request_data | Datas |
| RestException | 401 |
| RestException | 404 |
| RestException | 500 |
Definition at line 314 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource(), and DolibarrApi\_checkValForAPI().