dolibarr  7.0.0-beta
Public Member Functions | List of all members
Contacts Class Reference
+ Inheritance diagram for Contacts:
+ Collaboration diagram for Contacts:

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a contact object. 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...
 
 _cleanObjectDatas ($object)
 Clean sensible object datas. More...
 
 _validate ($data)
 Validate fields before create or update object. More...
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor. More...
 
 _cleanObjectDatas ($object)
 Executed method when API is called without parameter. More...
 
 _checkFilters ($sqlfilters)
 Return if a $sqlfilters parameter is valid. More...
 

Additional Inherited Members

- Static Public 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...
 

Detailed Description

Definition at line 30 of file api_contacts.class.php.

Member Function Documentation

Contacts::_cleanObjectDatas (   $object)

Clean sensible object datas.

Parameters
object$objectObject to clean
Returns
array Array of cleaned object properties

Definition at line 367 of file api_contacts.class.php.

Referenced by get().

Contacts::_validate (   $data)

Validate fields before create or update object.

Parameters
array | null$dataData to validate
Returns
array
Exceptions
RestException

Definition at line 391 of file api_contacts.class.php.

Referenced by post().

Contacts::createUser (   $id,
  $request_data = NULL 
)

Create an user account object from contact (external user)

Parameters
int$idId of contact
array$request_dataRequest datas
Returns
int ID of user

POST {id}/createUser

Definition at line 285 of file api_contacts.class.php.

References DolibarrApi\_checkAccessToResource().

Contacts::delete (   $id)

Delete contact.

Parameters
int$idContact ID
Returns
integer

Definition at line 257 of file api_contacts.class.php.

References DolibarrApi\_checkAccessToResource().

Contacts::get (   $id)

Get properties of a contact object.

Return an array with contact informations

Parameters
int$idID of contact
Returns
array|mixed data without useless information
Exceptions
RestException

Definition at line 69 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.

Parameters
int$idID of contact
string$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
Returns
mixed

GET {id}/categories

Definition at line 339 of file api_contacts.class.php.

Contacts::post (   $request_data = NULL)

Create contact object.

Parameters
array$request_dataRequest datas
Returns
int ID of contact

Definition at line 197 of file api_contacts.class.php.

References _validate().

Contacts::put (   $id,
  $request_data = NULL 
)

Update contact.

Parameters
int$idId of contact to update
array$request_dataDatas
Returns
int

Definition at line 222 of file api_contacts.class.php.

References DolibarrApi\_checkAccessToResource().


The documentation for this class was generated from the following file: