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

Public Member Functions

 __construct ()
 Constructor.
 
 index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0)
 Get the list of salaries.
 
 get ($id)
 Get salary by ID.
 
 post ($request_data=null)
 Create salary object.
 
 put ($id, $request_data=null)
 Update salary.
 
 getAllPayments ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0)
 Delete salary.
 
 getPayments ($pid)
 Get a given payment.
 
 addPayment ($id, $request_data=null)
 Create payment salary on a salary.
 
 updatePayment ($id, $request_data=null)
 Update paymentsalary.
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor.
 

Static Public Attributes

static $FIELDSPAYMENT
 array $FIELDS Mandatory fields, checked when creating an object
 

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)
 Delete a payment salary.
 
 _validatepayments ($data)
 Validate fields before creating an 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 31 of file api_salaries.class.php.

Member Function Documentation

◆ _cleanObjectDatas()

Salaries::_cleanObjectDatas ( $object)
protected

Clean sensible object datas.

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

Reimplemented from DolibarrApi.

Definition at line 464 of file api_salaries.class.php.

References $object.

Referenced by get(), getAllPayments(), getPayments(), and index().

◆ _validate()

Salaries::_validate ( $data)
private

Delete a payment salary.

Parameters
int$idID of payment salary
Returns
array

@url DELETE {id}/payments Validate fields before creating an object

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

Definition at line 423 of file api_salaries.class.php.

Referenced by post().

◆ _validatepayments()

Salaries::_validatepayments ( $data)
private

Validate fields before creating an object.

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

Definition at line 443 of file api_salaries.class.php.

References $FIELDSPAYMENT.

Referenced by addPayment().

◆ addPayment()

Salaries::addPayment ( $id,
$request_data = null )

Create payment salary on a salary.

Parameters
int$idId of salary
array$request_dataRequest data
Returns
int ID of paymentsalary

@url POST {id}/payments

Exceptions
RestException

Definition at line 316 of file api_salaries.class.php.

References $id, DolibarrApi\_checkValForAPI(), and _validatepayments().

◆ get()

Salaries::get ( $id)

Get salary by ID.

Parameters
int$idID of salary
Returns
Object Salary object
Exceptions
RestException

Definition at line 122 of file api_salaries.class.php.

References $id, and _cleanObjectDatas().

◆ getAllPayments()

Salaries::getAllPayments ( $sortfield = "t.rowid",
$sortorder = 'ASC',
$limit = 100,
$page = 0 )

Delete salary.

Parameters
int$idID of salary
Returns
array Get the list of payment of salaries.
Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
Returns
array List of paymentsalary objects

@url GET /payments

Exceptions
RestException

Definition at line 238 of file api_salaries.class.php.

References _cleanObjectDatas(), and dol_syslog().

◆ getPayments()

Salaries::getPayments ( $pid)

Get a given payment.

Parameters
int$pidID of payment salary
Returns
Object PaymentSalary object

@url GET /payments/{pid}

Exceptions
RestException

Definition at line 290 of file api_salaries.class.php.

References _cleanObjectDatas().

◆ index()

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

Get the list of salaries.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitLimit for list
int$pagePage number
Returns
array List of salary objects
Exceptions
RestException

Definition at line 73 of file api_salaries.class.php.

References _cleanObjectDatas(), and dol_syslog().

◆ post()

Salaries::post ( $request_data = null)

Create salary object.

Parameters
array$request_dataRequest data
Returns
int ID of salary

Definition at line 143 of file api_salaries.class.php.

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

◆ put()

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

Update salary.

Parameters
int$idID of salary
array$request_dataData
Returns
Object Updated object

Definition at line 169 of file api_salaries.class.php.

References $id, and DolibarrApi\_checkValForAPI().

◆ updatePayment()

Salaries::updatePayment ( $id,
$request_data = null )

Update paymentsalary.

Parameters
int$idID of paymentsalary
array$request_datadata
Returns
Object PaymentSalary object

@url POST {id}/payments

Exceptions
RestException

Definition at line 357 of file api_salaries.class.php.

References $id, and DolibarrApi\_checkValForAPI().


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