dolibarr  17.0.4
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Tickets Class Reference
Inheritance diagram for Tickets:
Inheritance graph
[legend]
Collaboration diagram for Tickets:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 Constructor.
 
 get ($id)
 Get properties of a Ticket object. More...
 
 getByTrackId ($track_id)
 Get properties of a Ticket object from track id. More...
 
 getByRef ($ref)
 Get properties of a Ticket object from ref. More...
 
 index ($socid=0, $sortfield="t.rowid", $sortorder="ASC", $limit=100, $page=0, $sqlfilters='')
 List tickets. More...
 
 post ($request_data=null)
 Create ticket object. More...
 
 postNewMessage ($request_data=null)
 Create ticket object. More...
 
 put ($id, $request_data=null)
 Update ticket. More...
 
 delete ($id)
 Delete ticket. More...
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor. More...
 

Protected Member Functions

 _cleanObjectDatas ($object)
 Clean sensible object datas. More...
 
- Protected Member Functions inherited from DolibarrApi
 _checkValForAPI ($field, $value, $object)
 Check and convert a string depending on its type/name. More...
 
 _checkFilters ($sqlfilters, &$error='')
 Return if a $sqlfilters parameter is valid Function no more used. More...
 

Private Member Functions

 getCommon ($id=0, $track_id='', $ref='')
 Get properties of a Ticket object Return an array with ticket informations. More...
 
 _validate ($data)
 Validate fields before create or update object. More...
 
 _validateMessage ($data)
 Validate fields before create or update object message. More...
 

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. More...
 
static _forge_criteria_callback ($matches)
 Function to forge a SQL criteria from a Generic filter string. More...
 

Detailed Description

Definition at line 30 of file api_tickets.class.php.

Member Function Documentation

◆ _cleanObjectDatas()

Tickets::_cleanObjectDatas (   $object)
protected

Clean sensible object datas.

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

Reimplemented from DolibarrApi.

Definition at line 477 of file api_tickets.class.php.

◆ _validate()

Tickets::_validate (   $data)
private

Validate fields before create or update object.

Parameters
array$dataData to validate
Returns
array
Exceptions
RestException

Definition at line 435 of file api_tickets.class.php.

◆ _validateMessage()

Tickets::_validateMessage (   $data)
private

Validate fields before create or update object message.

Parameters
array$dataData to validate
Returns
array
Exceptions
RestException

Definition at line 455 of file api_tickets.class.php.

◆ delete()

Tickets::delete (   $id)

Delete ticket.

Parameters
int$idTicket ID
Returns
array

Definition at line 401 of file api_tickets.class.php.

◆ get()

Tickets::get (   $id)

Get properties of a Ticket object.

Return an array with ticket informations

Parameters
int$idID of ticket
Returns
array|mixed Data without useless information
Exceptions
RestException401
RestException403
RestException404

Definition at line 75 of file api_tickets.class.php.

◆ getByRef()

Tickets::getByRef (   $ref)

Get properties of a Ticket object from ref.

Return an array with ticket informations

Parameters
string$refReference for ticket
Returns
array|mixed Data without useless information

@url GET ref/{ref}

Exceptions
RestException401
RestException403
RestException404

Definition at line 113 of file api_tickets.class.php.

◆ getByTrackId()

Tickets::getByTrackId (   $track_id)

Get properties of a Ticket object from track id.

Return an array with ticket informations

Parameters
string$track_idTracking ID of ticket
Returns
array|mixed Data without useless information

@url GET track_id/{track_id}

Exceptions
RestException401
RestException403
RestException404

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

◆ getCommon()

Tickets::getCommon (   $id = 0,
  $track_id = '',
  $ref = '' 
)
private

Get properties of a Ticket object Return an array with ticket informations.

Parameters
int$idID of ticket
string$track_idTracking ID of ticket
string$refReference for ticket
Returns
array|mixed Data without useless information

Definition at line 131 of file api_tickets.class.php.

◆ index()

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

List tickets.

Get a list of tickets

Parameters
int$socidFilter list with thirdparty ID
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') and (t.fk_statut:=:1)"
Returns
array Array of ticket objects

Definition at line 205 of file api_tickets.class.php.

◆ post()

Tickets::post (   $request_data = null)

Create ticket object.

Parameters
array$request_dataRequest datas
Returns
int ID of ticket

Definition at line 303 of file api_tickets.class.php.

References db.

◆ postNewMessage()

Tickets::postNewMessage (   $request_data = null)

Create ticket object.

Parameters
array$request_dataRequest datas
Returns
int ID of ticket

Definition at line 336 of file api_tickets.class.php.

References db.

◆ put()

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

Update ticket.

Parameters
int$idId of ticket to update
array$request_dataDatas
Returns
int

Definition at line 368 of file api_tickets.class.php.


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