dolibarr  9.0.0
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

◆ _cleanObjectDatas()

Members::_cleanObjectDatas (   $object)

Clean sensible object datas.

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

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

◆ _validate()

Members::_validate (   $data)

Validate fields before creating an object.

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

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

◆ createSubscription()

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 364 of file api_members.class.php.

◆ delete()

Members::delete (   $id)

Delete member.

Parameters
int$idmember ID
Returns
array

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

◆ get()

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.

◆ getCategories()

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 392 of file api_members.class.php.

◆ getSubscriptions()

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 331 of file api_members.class.php.

◆ index()

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.

◆ post()

Members::post (   $request_data = null)

Create member object.

Parameters
array$request_dataRequest data
Returns
int ID of member

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

◆ put()

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

Update member.

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

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


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