dolibarr 24.0.0-beta
Zapier Class Reference
Inheritance diagram for Zapier:
Collaboration diagram for Zapier:

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a hook object.
 
 getModulesChoices ()
 Get list of possibles choices for module.
 
 index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='', $properties='')
 List hooks.
 
 post ($request_data=null)
 Create hook object.
 
 delete ($id)
 Delete hook.
 
 _cleanObjectDatas ($object)
 Clean sensible object datas.
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor.
 

Private Member Functions

 validate ($data, $fields)
 Validate fields before create or update object.
 

Additional Inherited Members

- Protected Member Functions inherited from DolibarrApi
 _checkValForAPI ($field, $value, $object)
 Check and convert a string depending on its type/name.
 
 _checkValExtrafieldsForAPI ($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.
 
- 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 37 of file api_zapier.class.php.

Constructor & Destructor Documentation

◆ __construct()

Zapier::__construct ( )

Constructor.

@url GET /

Definition at line 57 of file api_zapier.class.php.

References $db.

Member Function Documentation

◆ _cleanObjectDatas()

Zapier::_cleanObjectDatas ( $object)

Clean sensible object datas.

@phpstan-template T

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

@phpstan-param T $object @phpstan-return T

Reimplemented from DolibarrApi.

Definition at line 301 of file api_zapier.class.php.

References $object.

Referenced by get(), and index().

◆ delete()

Zapier::delete ( $id)

Delete hook.

Parameters
int$idHook ID
Returns
array @phan-return array{success:array{code:int,message:string}} @phpstan-return array{success:array{code:int,message:string}}

@url DELETE /hook/{id}

Definition at line 262 of file api_zapier.class.php.

References $id, and DolibarrApi\_checkAccessToResource().

◆ get()

Zapier::get ( $id)

Get properties of a hook object.

Return an array with hook information

Parameters
int$idID of hook
Returns
Object Object with cleaned properties

@url GET /hooks/{id}

Exceptions
RestException

Definition at line 76 of file api_zapier.class.php.

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

◆ getModulesChoices()

Zapier::getModulesChoices ( )

Get list of possibles choices for module.

Return an array with hook information

Returns
array data @phan-return array<string,string> @phpstan-return array<string,string>

@url GET /getmoduleschoices/

Exceptions
RestException

Definition at line 106 of file api_zapier.class.php.

◆ index()

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

List hooks.

Get a list of hooks

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.date_creation:>:'20160101')"
string$propertiesRestrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
Returns
array Array of order objects @phan-return Hook[] @phpstan-return Hook[]
Exceptions
RestException

@url GET /hooks/

Definition at line 150 of file api_zapier.class.php.

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

◆ post()

Zapier::post ( $request_data = null)

Create hook object.

Parameters
array$request_dataRequest data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data
Returns
array ID of hook @phan-return array{id:int} @phpstan-return array{id:int}

@url POST /hook/

Definition at line 218 of file api_zapier.class.php.

References DolibarrApi\_checkValForAPI(), dol_syslog(), sanitizeVal(), and validate().

◆ validate()

Zapier::validate ( $data,
$fields )
private

Validate fields before create or update object.

Parameters
?array<string,mixed>$data Array of data to validate
string[]$fieldsArray of fields needed
Returns
array<string,mixed>
Exceptions
RestException

Definition at line 318 of file api_zapier.class.php.

Referenced by post().


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