dolibarr 21.0.0-alpha
Webhook Class Reference
Inheritance diagram for Webhook:
Collaboration diagram for Webhook:

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a target object.
 
 index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='', $properties='', $pagination_data=false)
 List targets.
 
 post ($request_data=null)
 Create target object.
 
 put ($id, $request_data=null)
 Update target.
 
 delete ($id)
 Delete target.
 
 listOfTriggers ()
 Get the list of all available triggers.
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor.
 

Protected Member Functions

 _cleanObjectDatas ($object)
 Clean sensible object datas.
 
- 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.
 
 _checkFilters ($sqlfilters, &$error='')
 Return if a $sqlfilters parameter is valid Function no more used.
 

Private Member Functions

 _validate ($data)
 Validate fields before create or update object.
 
 _fetch ($rowid, $ref='')
 Fetch properties of a target object.
 

Additional Inherited Members

- 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 27 of file api_webhook.class.php.

Member Function Documentation

◆ _cleanObjectDatas()

Webhook::_cleanObjectDatas ( $object)
protected

Clean sensible object datas.

Parameters
Object$objectObject to clean
Returns
Object Object with cleaned properties

Reimplemented from DolibarrApi.

Definition at line 312 of file api_webhook.class.php.

References $object.

Referenced by _fetch(), and index().

◆ _fetch()

Webhook::_fetch ( $rowid,
$ref = '' )
private

Fetch properties of a target object.

Return an array with target information

Parameters
int$rowidId of target party to load (Use 0 to get a specimen record, use null to use other search criteria)
string$refReference of target party, name (Warning, this can return several records)
Returns
object cleaned target object
Exceptions
RestException

Definition at line 398 of file api_webhook.class.php.

References _cleanObjectDatas().

Referenced by get().

◆ _validate()

Webhook::_validate ( $data)
private

Validate fields before create or update object.

Parameters
array$dataDatas to validate
Returns
array
Exceptions
RestException

Definition at line 293 of file api_webhook.class.php.

Referenced by post().

◆ delete()

Webhook::delete ( $id)

Delete target.

Parameters
int$idTarget ID
Returns
array

Definition at line 229 of file api_webhook.class.php.

References $id.

◆ get()

Webhook::get ( $id)

Get properties of a target object.

Return an array with target information

Parameters
int$idId of target to load
Returns
Object Object with cleaned properties
Exceptions
RestException

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

References $id, and _fetch().

◆ index()

Webhook::index ( $sortfield = "t.rowid",
$sortorder = 'ASC',
$limit = 100,
$page = 0,
$sqlfilters = '',
$properties = '',
$pagination_data = false )

List targets.

Get a list of targets

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.nom:like:'TheCompany%') or (t.name_alias:like:'TheCompany%')) and (t.datec:<:'20160101')"
string$propertiesRestrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
bool$pagination_dataIf this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0*
Returns
array Array of target objects

Definition at line 85 of file api_webhook.class.php.

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

◆ listOfTriggers()

Webhook::listOfTriggers ( )

Get the list of all available triggers.

Returns
array

@url GET triggers

Definition at line 260 of file api_webhook.class.php.

◆ post()

Webhook::post ( $request_data = null)

Create target object.

Parameters
array$request_dataRequest datas
Returns
int ID of target

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

References DolibarrApi\_checkValForAPI(), and _validate().

◆ put()

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

Update target.

Parameters
int$idId of target to update
array$request_dataDatas
Returns
Object|false Updated object
Exceptions
RestException401
RestException404
RestException500

Definition at line 198 of file api_webhook.class.php.

References $id, and DolibarrApi\_checkValForAPI().


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