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

Public Member Functions

 __construct ()
 Constructor.
 
 index ($sortfield="t.rowid", $sortorder= 'ASC', $limit=100, $page=0, $user_ids=0, $sqlfilters= '')
 List Users. More...
 
 get ($id)
 Get properties of an user object. More...
 
 post ($request_data=NULL)
 Create user account. More...
 
 put ($id, $request_data=NULL)
 Update account. More...
 
 setGroup ($id, $group)
 add user to group More...
 
 delete ($id)
 Delete account. 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 28 of file api_users.class.php.

Member Function Documentation

Users::_cleanObjectDatas (   $object)

Clean sensible object datas.

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

Definition at line 292 of file api_users.class.php.

Referenced by get(), and index().

Users::_validate (   $data)

Validate fields before create or update object.

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

Definition at line 351 of file api_users.class.php.

Users::delete (   $id)

Delete account.

Parameters
int$idAccount ID
Returns
array

Definition at line 268 of file api_users.class.php.

References DolibarrApi\_checkAccessToResource().

Users::get (   $id)

Get properties of an user object.

Return an array with user informations

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

Definition at line 139 of file api_users.class.php.

References DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().

Users::index (   $sortfield = "t.rowid",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $user_ids = 0,
  $sqlfilters = '' 
)

List Users.

Get a list of Users

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
string$user_idsUser ids filter field. Example: '1' or '1,2,3' { /^[0-9,]*$/i}
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
Returns
array Array of User objects

Definition at line 66 of file api_users.class.php.

References DolibarrApi\_checkFilters(), and _cleanObjectDatas().

Users::post (   $request_data = NULL)

Create user account.

Parameters
array$request_dataNew user data
Returns
int

Definition at line 165 of file api_users.class.php.

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

Update account.

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

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

References DolibarrApi\_checkAccessToResource().

Users::setGroup (   $id,
  $group 
)

add user to group

Parameters
int$idUser ID
int$groupGroup ID
Returns
int 1 if success

GET {id}/setGroup/{group}

Definition at line 238 of file api_users.class.php.

References DolibarrApi\_checkAccessToResource().


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