dolibarr 19.0.3
Subscriptions Class Reference
Inheritance diagram for Subscriptions:
Collaboration diagram for Subscriptions:

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a subscription object.
 
 index ($sortfield="dateadh", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='', $properties='')
 List subscriptions.
 
 post ($request_data=null)
 Create subscription object.
 
 put ($id, $request_data=null)
 Update subscription.
 
 delete ($id)
 Delete subscription.
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor.
 

Private Member Functions

 _validate ($data)
 Validate fields before creating an object.
 

Additional Inherited Members

- Protected Member Functions inherited from DolibarrApi
 _checkValForAPI ($field, $value, $object)
 Check and convert a string depending on its type/name.
 
 _filterObjectProperties ($object, $properties)
 Filter properties that will be returned on object.
 
 _cleanObjectDatas ($object)
 Clean sensible object datas.
 
 _checkFilters ($sqlfilters, &$error='')
 Return if a $sqlfilters parameter is valid Function no more used.
 
- Static Protected Member Functions inherited from DolibarrApi
static _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
 Check access by user to a given resource.
 
static _forge_criteria_callback ($matches)
 Function to forge a SQL criteria from a Generic filter string.
 

Detailed Description

Definition at line 28 of file api_subscriptions.class.php.

Member Function Documentation

◆ _validate()

Subscriptions::_validate ( $data)
private

Validate fields before creating an object.

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

Definition at line 250 of file api_subscriptions.class.php.

Referenced by post().

◆ delete()

Subscriptions::delete ( $id)

Delete subscription.

Parameters
int$idID of subscription to delete
Returns
array

Definition at line 215 of file api_subscriptions.class.php.

◆ get()

Subscriptions::get ( $id)

Get properties of a subscription object.

Return an array with subscription informations

Parameters
int$idID of subscription
Returns
Object Object with cleaned properties
Exceptions
RestException

Definition at line 59 of file api_subscriptions.class.php.

References DolibarrApi\_cleanObjectDatas().

◆ index()

Subscriptions::index ( $sortfield = "dateadh",
$sortorder = 'ASC',
$limit = 100,
$page = 0,
$sqlfilters = '',
$properties = '' )

List subscriptions.

Get a list of subscriptions

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.import_key:<:'20160101')"
string$propertiesRestrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names
Returns
array Array of subscription objects
Exceptions
RestException

Definition at line 89 of file api_subscriptions.class.php.

References DolibarrApi\_cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), and forgeSQLFromUniversalSearchCriteria().

◆ post()

Subscriptions::post ( $request_data = null)

Create subscription object.

Parameters
array$request_dataRequest data
Returns
int ID of subscription

Definition at line 146 of file api_subscriptions.class.php.

References _validate().

◆ put()

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

Update subscription.

Parameters
int$idID of subscription to update
array$request_dataDatas
Returns
Object

Definition at line 177 of file api_subscriptions.class.php.


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