|
|
| __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...
|
| |
| | __construct ($db, $cachedir='', $refreshCache=false) |
| | Constructor. More...
|
| |
Definition at line 31 of file api_contacts.class.php.
◆ _cleanObjectDatas()
| Contacts::_cleanObjectDatas |
( |
|
$object | ) |
|
|
protected |
Clean sensible object datas.
- Parameters
-
| Object | $object | Object to clean |
- Returns
- Object Object with cleaned properties
Reimplemented from DolibarrApi.
Definition at line 543 of file api_contacts.class.php.
◆ _validate()
| Contacts::_validate |
( |
|
$data | ) |
|
|
private |
Validate fields before create or update object.
- Parameters
-
| array | null | $data | Data to validate |
- Returns
- array
- Exceptions
-
Definition at line 568 of file api_contacts.class.php.
◆ addCategory()
| Contacts::addCategory |
( |
|
$id, |
|
|
|
$category_id |
|
) |
| |
Add a category to a contact.
@url POST {id}/categories/{category_id}
- Parameters
-
| int | $id | Id of contact |
| int | $category_id | Id of category |
- Returns
- mixed
- Exceptions
-
| RestException | 401 Insufficient rights |
| RestException | 404 Category or contact not found |
Definition at line 468 of file api_contacts.class.php.
◆ createUser()
| Contacts::createUser |
( |
|
$id, |
|
|
|
$request_data = null |
|
) |
| |
Create an user account object from contact (external user)
- Parameters
-
| int | $id | Id of contact |
| array | $request_data | Request datas |
- Returns
- int ID of user
@url POST {id}/createUser
Definition at line 377 of file api_contacts.class.php.
◆ delete()
◆ deleteCategory()
| Contacts::deleteCategory |
( |
|
$id, |
|
|
|
$category_id |
|
) |
| |
Remove the link between a category and a contact.
@url DELETE {id}/categories/{category_id}
- Parameters
-
| int | $id | Id of contact |
| int | $category_id | Id of category |
- Returns
- mixed
- Exceptions
-
| RestException | 401 Insufficient rights |
| RestException | 404 Category or contact not found |
Definition at line 508 of file api_contacts.class.php.
◆ get()
| Contacts::get |
( |
|
$id, |
|
|
|
$includecount = 0, |
|
|
|
$includeroles = 0 |
|
) |
| |
Get properties of a contact object.
Return an array with contact informations
- Parameters
-
| 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 |
- Returns
- array|mixed data without useless information
- Exceptions
-
Definition at line 72 of file api_contacts.class.php.
◆ getByEmail()
| Contacts::getByEmail |
( |
|
$email, |
|
|
|
$includecount = 0, |
|
|
|
$includeroles = 0 |
|
) |
| |
Get properties of a contact object by Email.
- Parameters
-
| string | $email | 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 |
- Returns
- array|mixed data without useless information
@url GET email/{email}
- Exceptions
-
| RestException | 401 Insufficient rights |
| RestException | 404 User or group not found |
Definition at line 120 of file api_contacts.class.php.
◆ getCategories()
| Contacts::getCategories |
( |
|
$id, |
|
|
|
$sortfield = "s.rowid", |
|
|
|
$sortorder = 'ASC', |
|
|
|
$limit = 0, |
|
|
|
$page = 0 |
|
) |
| |
Get categories for a contact.
- Parameters
-
| int | $id | ID of contact |
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
- Returns
- mixed
@url GET {id}/categories
Definition at line 434 of file api_contacts.class.php.
◆ index()
| 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
- Parameters
-
| 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 |
- Returns
- array Array of contact objects
- Exceptions
-
Definition at line 173 of file api_contacts.class.php.
◆ post()
| Contacts::post |
( |
|
$request_data = null | ) |
|
Create contact object.
- Parameters
-
| array | $request_data | Request datas |
- Returns
- int ID of contact
Definition at line 285 of file api_contacts.class.php.
◆ put()
| Contacts::put |
( |
|
$id, |
|
|
|
$request_data = null |
|
) |
| |
Update contact.
- Parameters
-
| int | $id | Id of contact to update |
| array | $request_data | Datas |
- Returns
- int
Definition at line 312 of file api_contacts.class.php.
The documentation for this class was generated from the following file: