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

Public Member Functions

 __construct ()
 Constructor.
 
 index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='', $properties='')
 List Currencies.
 
 get ($id)
 Get properties of a Currency object.
 
 getByCode ($code)
 Get properties of a Currency object by code.
 
 getRates ($id)
 List Currency rates.
 
 post ($request_data=null)
 Create Currency object.
 
 put ($id, $request_data=null)
 Update Currency.
 
 delete ($id)
 Delete Currency.
 
 updateRate ($id, $request_data=null)
 Update Currency rate @url PUT {id}/rates.
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor.
 

Protected Member Functions

 _cleanObjectDatas ($object)
 Clean sensible object datas @phpstan-template T.
 
 _cleanObjectDatasRate ($object)
 Clean sensible CurrencyRate object datas.
 
- 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.
 

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_multicurrencies.class.php.

Member Function Documentation

◆ _cleanObjectDatas()

MultiCurrencies::_cleanObjectDatas ( $object)
protected

Clean sensible object datas @phpstan-template T.

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

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

Reimplemented from DolibarrApi.

Definition at line 372 of file api_multicurrencies.class.php.

References $object, and _cleanObjectDatasRate().

Referenced by get(), getByCode(), index(), and updateRate().

◆ _cleanObjectDatasRate()

MultiCurrencies::_cleanObjectDatasRate ( $object)
protected

Clean sensible CurrencyRate object datas.

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

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

Definition at line 402 of file api_multicurrencies.class.php.

References $object.

Referenced by _cleanObjectDatas(), and getRates().

◆ delete()

MultiCurrencies::delete ( $id)

Delete Currency.

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

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

References $id.

◆ get()

MultiCurrencies::get ( $id)

Get properties of a Currency object.

Return an array with Currency information

Parameters
int$idID of Currency
Returns
Object Object with cleaned properties
Exceptions
RestException

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

References $id, and _cleanObjectDatas().

◆ getByCode()

MultiCurrencies::getByCode ( $code)

Get properties of a Currency object by code.

Return an array with Currency information @url GET /bycode/{code}

Parameters
string$codeCode of Currency (ex: EUR)
Returns
array|mixed Data without useless information
Exceptions
RestException

Definition at line 147 of file api_multicurrencies.class.php.

References _cleanObjectDatas().

◆ getRates()

MultiCurrencies::getRates ( $id)

List Currency rates.

Get a list of Currency rates

@url GET {id}/rates

Parameters
int$idID of Currency
Returns
array|mixed Data without useless information
Exceptions
RestException

Definition at line 172 of file api_multicurrencies.class.php.

References $id, and _cleanObjectDatasRate().

◆ index()

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

List Currencies.

Get a list of Currencies

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.product_id:=:1) 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 warehouse objects @phan-return MultiCurrency[] @phpstan-return MultiCurrency[]
Exceptions
RestException

Definition at line 60 of file api_multicurrencies.class.php.

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

◆ post()

MultiCurrencies::post ( $request_data = null)

Create Currency object.

Parameters
array$request_dataRequest data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data
Returns
int ID of Currency
Exceptions
RestException

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

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

◆ put()

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

Update Currency.

Parameters
int$idId of Currency to update
array$request_dataData @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data
Returns
Object The updated Currency
Exceptions
RestException

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

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

◆ updateRate()

MultiCurrencies::updateRate ( $id,
$request_data = null )

Update Currency rate @url PUT {id}/rates.

Parameters
int$idCurrency ID
array$request_dataRequest data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data
Returns
Object|false Object with cleaned properties
Exceptions
RestException

Definition at line 337 of file api_multicurrencies.class.php.

References $id, and _cleanObjectDatas().


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