|
dolibarr
13.0.2
|
Inheritance diagram for Contacts:
Collaboration diagram for Contacts:Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id, $includecount=0, $includeroles=0) | |
| Get properties of a contact object. More... | |
| getByEmail ($email, $includecount=0, $includeroles=0) | |
| Get properties of a contact object by Email. More... | |
| index ($sortfield="t.rowid", $sortorder= 'ASC', $limit=100, $page=0, $thirdparty_ids= '', $category=0, $sqlfilters= '', $includecount=0, $includeroles=0) | |
| List contacts. More... | |
| post ($request_data=null) | |
| Create contact object. More... | |
| put ($id, $request_data=null) | |
| Update contact. More... | |
| delete ($id) | |
| Delete contact. More... | |
| createUser ($id, $request_data=null) | |
| Create an user account object from contact (external user) More... | |
| getCategories ($id, $sortfield="s.rowid", $sortorder= 'ASC', $limit=0, $page=0) | |
| Get categories for a contact. More... | |
| addCategory ($id, $category_id) | |
| Add a category to a contact. More... | |
| deleteCategory ($id, $category_id) | |
| Remove the link between a category and a contact. 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 31 of file api_contacts.class.php.
|
protected |
Clean sensible object datas.
| Object | $object | Object to clean |
Definition at line 543 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 568 of file api_contacts.class.php.
Referenced by post().
| Contacts::addCategory | ( | $id, | |
| $category_id | |||
| ) |
Add a category to a contact.
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 468 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), and db.
| 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 |
POST {id}/createUser
Definition at line 379 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource(), and db.
| Contacts::delete | ( | $id | ) |
Delete contact.
| int | $id | Contact ID |
Definition at line 350 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource().
| Contacts::deleteCategory | ( | $id, | |
| $category_id | |||
| ) |
Remove the link between a category and a contact.
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 508 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), and db.
| 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 |
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 |
GET {id}/categories
Definition at line 434 of file api_contacts.class.php.
References db.
| 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') { /^[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 DolibarrApi\_checkFilters(), _cleanObjectDatas(), and db.
| Contacts::post | ( | $request_data = null | ) |
Create contact object.
| array | $request_data | Request datas |
Definition at line 288 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 |
Definition at line 314 of file api_contacts.class.php.
References DolibarrApi\_checkAccessToResource().