dolibarr  7.0.0-beta
Public Member Functions | Static Public Attributes | List of all members
BankAccounts Class Reference
+ Inheritance diagram for BankAccounts:
+ Collaboration diagram for BankAccounts:

Public Member Functions

 __construct ()
 Constructor.
 
 index ($sortfield="t.rowid", $sortorder= 'ASC', $limit=100, $page=0, $sqlfilters= '')
 Get the list of accounts. More...
 
 get ($id)
 Get account by ID. More...
 
 post ($request_data=null)
 Create account object. More...
 
 put ($id, $request_data=null)
 Update account. More...
 
 delete ($id)
 Delete account. More...
 
 _validate ($data)
 Validate fields before creating an object. More...
 
 _cleanObjectDatas ($object)
 Clean sensible object datas. More...
 
 getLines ($id)
 Get the list of lines of the account. More...
 
 addLine ($id, $date, $type, $label, $amount, $category=0, $cheque_number='', $cheque_writer='', $cheque_bank='')
 Add a line to an account. More...
 
 addLink ($id, $line_id, $url_id, $url, $label, $type)
 Add a link to an account line. More...
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor. More...
 
 _cleanObjectDatas ($object)
 Executed method when API is called without parameter. More...
 
 _checkFilters ($sqlfilters)
 Return if a $sqlfilters parameter is valid. More...
 

Static Public Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from DolibarrApi
static _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
 Check user access to a resource. More...
 
static _forge_criteria_callback ($matches)
 Function to forge a SQL criteria. More...
 

Detailed Description

Definition at line 29 of file api_bankaccounts.class.php.

Member Function Documentation

BankAccounts::_cleanObjectDatas (   $object)

Clean sensible object datas.

Parameters
object$objectObject to clean
Returns
array Array of cleaned object properties

Definition at line 257 of file api_bankaccounts.class.php.

Referenced by get(), getLines(), and index().

BankAccounts::_validate (   $data)

Validate fields before creating an object.

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

Definition at line 240 of file api_bankaccounts.class.php.

References $FIELDS.

Referenced by post().

BankAccounts::addLine (   $id,
  $date,
  $type,
  $label,
  $amount,
  $category = 0,
  $cheque_number = '',
  $cheque_writer = '',
  $cheque_bank = '' 
)

Add a line to an account.

Parameters
int$idID of account
int$datePayment date (timestamp) { body} { timestamp}
string$typePayment mode (TYP,VIR,PRE,LIQ,VAD,CB,CHQ...) { body}
string$labelLabel { body}
float$amountAmount (may be 0) { body}
int$categoryCategory
string$cheque_numberCheque numberl { body}
string$cheque_writerName of cheque writer { body}
string$cheque_bankBank of cheque writer { body}
Returns
int ID of line

POST {id}/lines

Definition at line 328 of file api_bankaccounts.class.php.

BankAccounts::addLink (   $id,
  $line_id,
  $url_id,
  $url,
  $label,
  $type 
)

Add a link to an account line.

Parameters
int$idID of account
int$line_idID of account line
int$url_idID to set in the URL { body}
string$urlURL of the link { body}
string$labelLabel { body}
string$typeType of link ('payment', 'company', 'member', ...) { body}
Returns
int ID of link

POST {id}/lines/{line_id}/links

Definition at line 361 of file api_bankaccounts.class.php.

BankAccounts::delete (   $id)

Delete account.

Parameters
int$idID of account
Returns
array

Definition at line 209 of file api_bankaccounts.class.php.

BankAccounts::get (   $id)

Get account by ID.

Parameters
int$idID of account
Returns
array Account object
Exceptions
RestException

Definition at line 124 of file api_bankaccounts.class.php.

References _cleanObjectDatas().

BankAccounts::getLines (   $id)

Get the list of lines of the account.

Parameters
int$idID of account
Returns
array Array of AccountLine objects
Exceptions
RestExceptionGET {id}/lines

Definition at line 276 of file api_bankaccounts.class.php.

References _cleanObjectDatas().

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

Get the list of accounts.

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')"
Returns
array List of account objects
Exceptions
RestException

Definition at line 64 of file api_bankaccounts.class.php.

References DolibarrApi\_checkFilters(), _cleanObjectDatas(), and dol_syslog().

BankAccounts::post (   $request_data = null)

Create account object.

Parameters
array$request_dataRequest data
Returns
int ID of account

Definition at line 145 of file api_bankaccounts.class.php.

References _validate().

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

Update account.

Parameters
int$idID of account
array$request_datadata
Returns
int

Definition at line 176 of file api_bankaccounts.class.php.


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