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

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a member object. More...
 
 index ($sortfield="t.rowid", $sortorder= 'ASC', $limit=100, $page=0, $typeid= '', $sqlfilters= '')
 List members. More...
 
 post ($request_data=null)
 Create member object. More...
 
 put ($id, $request_data=null)
 Update member. More...
 
 delete ($id)
 Delete member. More...
 
 _validate ($data)
 Validate fields before creating an object. More...
 
 _cleanObjectDatas ($object)
 Clean sensible object datas. More...
 
 getSubscriptions ($id)
 List subscriptions of a member. More...
 
 createSubscription ($id, $start_date, $end_date, $amount, $label='')
 Add a subscription for a member. More...
 
 getCategories ($id, $sortfield="s.rowid", $sortorder= 'ASC', $limit=0, $page=0)
 Get categories for a member. 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 31 of file api_members.class.php.

Member Function Documentation

Members::_cleanObjectDatas (   $object)

Clean sensible object datas.

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

Definition at line 296 of file api_members.class.php.

Referenced by get(), getSubscriptions(), and index().

Members::_validate (   $data)

Validate fields before creating an object.

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

Definition at line 279 of file api_members.class.php.

Referenced by post().

Members::createSubscription (   $id,
  $start_date,
  $end_date,
  $amount,
  $label = '' 
)

Add a subscription for a member.

Parameters
int$idID of member
int$start_dateStart date { body} { timestamp}
int$end_dateEnd date { body} { timestamp}
float$amountAmount (may be 0) { body}
string$labelLabel { body}
Returns
int ID of subscription

POST {id}/subscriptions

Definition at line 362 of file api_members.class.php.

Members::delete (   $id)

Delete member.

Parameters
int$idmember ID
Returns
array

Definition at line 244 of file api_members.class.php.

References DolibarrApi\_checkAccessToResource().

Members::get (   $id)

Get properties of a member object.

Return an array with member informations

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

Definition at line 60 of file api_members.class.php.

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

Members::getCategories (   $id,
  $sortfield = "s.rowid",
  $sortorder = 'ASC',
  $limit = 0,
  $page = 0 
)

Get categories for a member.

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

GET {id}/categories

Definition at line 390 of file api_members.class.php.

Members::getSubscriptions (   $id)

List subscriptions of a member.

Get a list of subscriptions

Parameters
int$idID of member
Returns
array Array of subscription objects
Exceptions
RestExceptionGET {id}/subscriptions

Definition at line 329 of file api_members.class.php.

References _cleanObjectDatas().

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

List members.

Get a list of members

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
string$typeidID of the type of member
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 member objects
Exceptions
RestException

Definition at line 94 of file api_members.class.php.

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

Members::post (   $request_data = null)

Create member object.

Parameters
array$request_dataRequest data
Returns
int ID of member

Definition at line 164 of file api_members.class.php.

References _validate().

Members::put (   $id,
  $request_data = null 
)

Update member.

Parameters
int$idID of member to update
array$request_dataDatas
Returns
int

Definition at line 189 of file api_members.class.php.

References DolibarrApi\_checkAccessToResource().


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