class Setup extends DolibarrApi (View source)

API class for dictionaries

Properties

protected DoliDB $db from  DolibarrApi
Restler $r from  DolibarrApi

Methods

__construct()

Constructor

string|array<string, mixed>
_checkValForAPI(string $field, string|string[] $value, object $object)

Check and convert a string depending on its type/name.

object
_filterObjectProperties(object $object, string $properties)

Filter properties that will be returned on object

object
_cleanObjectDatas(object $object)

Clean sensible object datas

static bool
_checkAccessToResource(string $resource, int $resource_id = 0, string $dbtablename = '', string $feature2 = '', string $dbt_keyfield = 'fk_soc', string $dbt_select = 'rowid')

Check access by user to a given resource

bool|string
_checkFilters(string $sqlfilters, string $error = '')

Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules

static string
_forge_criteria_callback(string[] $matches)

Function to forge a SQL criteria from a Generic filter string.

array
getListOfActionTriggers(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $elementtype = '', string $lang = '', string $sqlfilters = '')

Get the list of Action Triggers.

array
getOrderingMethods(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of ordering methods.

array
getOrderingOrigins(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of ordering origins.

array
getPaymentTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of payments types.

array
getListOfRegions(string $sortfield = "code_region", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $country = 0, string $filter = '', string $sqlfilters = '')

Get the list of regions.

object
getRegionByID(int $id)

Get region by ID.

object
getRegionByCode(string $code)

Get region by Code.

array
getListOfStates(string $sortfield = "code_departement", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $country = 0, string $filter = '', string $sqlfilters = '')

Get the list of states/provinces.

object
getStateByID(int $id)

Get state by ID.

object
getStateByCode(string $code)

Get state by Code.

array
getListOfCountries(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $filter = '', string $lang = '', string $sqlfilters = '')

Get the list of countries.

object
getCountryByID(int $id, string $lang = '')

Get country by ID.

object
getCountryByCode(string $code, string $lang = '')

Get country by Code.

object
getCountryByISO(string $iso, string $lang = '')

Get country by Iso.

array
getAvailability(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of delivery times.

array
getListOfEventTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $type = '', string $module = '', int $active = 1, string $sqlfilters = '')

Get the list of events types.

array
getListOfExpenseReportsTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $module = '', int $active = 1, string $sqlfilters = '')

Get the list of Expense Report types.

array
getListOfHolidayTypes(string $sortfield = "sortorder", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $fk_country = '', int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of holiday types.

array
getListOfPublicHolidays(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $fk_country = '', int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of public holiday.

array
getListOfContactTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $type = '', string $module = '', int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of contacts types.

array
getListOfCivilities(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $module = '', int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of civilities.

array
getListOfCurrencies(int $multicurrency = 0, string $sortfield = "code_iso", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of currencies.

array
getListOfExtrafields(string $sortfield = "t.pos", string $sortorder = 'ASC', string $elementtype = '', string $sqlfilters = '')

Get the list of extra fields.

array
deleteExtrafieldsFromNames(string $attrname, string $elementtype)

Delete extrafield

array
getExtrafields(string $attrname, string $elementtype)

get Extrafield object

int
postExtrafields(string $attrname, string $elementtype, array $request_data = null)

Create Extrafield object

int
updateExtrafields(string $attrname, string $elementtype, array $request_data = null)

Update Extrafield object

array
getListOfTowns(string $sortfield = "zip,town", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $zipcode = '', string $town = '', int $active = 1, string $sqlfilters = '')

Get the list of towns.

array
getPaymentTerms(string $sortfield = "sortorder", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of payments terms.

array
getShippingModes(int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of shipping methods.

array
getListOfMeasuringUnits(string $sortfield = "rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of measuring units.

array
getListOfLegalForm(string $sortfield = "rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $country = 0, int $active = 1, string $sqlfilters = '')

Get the list of legal form of business.

array
getListOfStaff(string $sortfield = "id", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of staff.

array
getListOfsocialNetworks(string $sortfield = "rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of social networks.

array
getTicketsCategories(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of tickets categories.

array
getTicketsSeverities(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of tickets severity.

array
getTicketsTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of tickets types.

array
getThirdpartiesTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of thirdparties types.

array
getListOfIncoterms(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of incoterms.

array
getListOfVAT(string $sortfield = "taux", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, int $fk_country = -1, string $sqlfilters = '')

Get the list of vat.

array
getCompany()

Get properties of company

array
getEstablishments()

Get the list of establishments.

object
getEtablishmentByID(int $id)

Get establishment by ID.

string
getConf(string $constantname)

Get value of a setup variables

array
getConfs()

Get all setup variables

array
getCheckIntegrity(string $target)

Do a test of integrity for files and setup.

array
getModules()

Get list of enabled modules

array|mixed
getModulesList(string $status = "active", string $origin = 'all')

Get list of modules with status and origin

array|mixed
enableModules(string $modulename)

PUT enable module

array|mixed
disableModules(string $modulename)

PUT enable module

Details

__construct()

Constructor

protected string|array<string, mixed> _checkValForAPI(string $field, string|string[] $value, object $object)

Check and convert a string depending on its type/name.

Parameters

string $field

Field name

string|string[] $value

Value to check/clean

object $object Object

Return Value

string|array<string, mixed>

Value cleaned

protected object _filterObjectProperties(object $object, string $properties)

Filter properties that will be returned on object

Parameters

object $object

Object to clean

string $properties

Comma separated list of properties names

Return Value

object

Object with cleaned properties

protected object _cleanObjectDatas(object $object)

Clean sensible object datas

Parameters

object $object

Object to clean

Return Value

object

Object with cleaned properties

static protected bool _checkAccessToResource(string $resource, int $resource_id = 0, string $dbtablename = '', string $feature2 = '', string $dbt_keyfield = 'fk_soc', string $dbt_select = 'rowid')

Check access by user to a given resource

Parameters

string $resource

element to check

int $resource_id

Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).

string $dbtablename

'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity. Not used if objectid is null (optional)

string $feature2

Feature to check, second level of permission (optional). Can be or check with 'level1|level2'.

string $dbt_keyfield

Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)

string $dbt_select

Field name for select if not rowid. Not used if objectid is null (optional)

Return Value

bool

protected bool|string _checkFilters(string $sqlfilters, string $error = '')

Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules

Parameters

string $sqlfilters

sqlfilter string

string $error

Error message

Return Value

bool|string

True if valid, False if not valid

static protected string _forge_criteria_callback(string[] $matches)

Function to forge a SQL criteria from a Generic filter string.

Function no more used. Kept for backward compatibility with old APIs of modules

Parameters

string[] $matches

Array of found string by regex search. Each entry is 1 and only 1 criteria. Example: "t.ref:like:'SO-%'", "t.date_creation:<:'20160101'", "t.date_creation:<:'2016-01-01 12:30:00'", "t.nature:is:NULL", "t.field2:isnot:NULL"

Return Value

string

Forged criteria. Example: "t.field like 'abc%'"

array getListOfActionTriggers(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $elementtype = '', string $lang = '', string $sqlfilters = '')

Get the list of Action Triggers.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number {@min 0}

string $elementtype

Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...)

string $lang

Code of the language the label of the type must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'SO-%')"

Return Value

array

List of extra fields

Exceptions

RestException
RestException

array getOrderingMethods(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of ordering methods.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number {@min 0}

int $active

Payment type is active or not {@min 0} {@max 1}

string $sqlfilters

SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"

Return Value

array

[List of ordering methods]

Exceptions

RestException
RestException
RestException

array getOrderingOrigins(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of ordering origins.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number {@min 0}

int $active

Payment type is active or not {@min 0} {@max 1}

string $sqlfilters

SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"

Return Value

array

[List of ordering reasons]

Exceptions

RestException
RestException
RestException

array getPaymentTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of payments types.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number {@min 0}

int $active

Payment type is active or not {@min 0} {@max 1}

string $sqlfilters

SQL criteria to filter with. Syntax example "(t.code:=:'CHQ')"

Return Value

array

[List of payment types]

Exceptions

RestException
RestException
RestException

array getListOfRegions(string $sortfield = "code_region", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $country = 0, string $filter = '', string $sqlfilters = '')

Get the list of regions.

The returned list is sorted by region ID.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $country

To filter on country

string $filter

To filter the regions by name

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of regions

Exceptions

RestException
RestException

object getRegionByID(int $id)

Get region by ID.

Parameters

int $id

ID of region

Return Value

object

Object with cleaned properties

Exceptions

RestException
RestException

object getRegionByCode(string $code)

Get region by Code.

Parameters

string $code

Code of region

Return Value

object

Object with cleaned properties

Exceptions

RestException
RestException

array getListOfStates(string $sortfield = "code_departement", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $country = 0, string $filter = '', string $sqlfilters = '')

Get the list of states/provinces.

The names of the states will be translated to the given language if the $lang parameter is provided. The value of $lang must be a language code supported by Dolibarr, for example 'en_US' or 'fr_FR'. The returned list is sorted by state ID.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $country

To filter on country

string $filter

To filter the states by name

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of states

Exceptions

RestException
RestException

object getStateByID(int $id)

Get state by ID.

Parameters

int $id

ID of state

Return Value

object

Object with cleaned properties

Exceptions

RestException
RestException

object getStateByCode(string $code)

Get state by Code.

Parameters

string $code

Code of state

Return Value

object

Object with cleaned properties

Exceptions

RestException
RestException

array getListOfCountries(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $filter = '', string $lang = '', string $sqlfilters = '')

Get the list of countries.

The names of the countries will be translated to the given language if the $lang parameter is provided. The value of $lang must be a language code supported by Dolibarr, for example 'en_US' or 'fr_FR'. The returned list is sorted by country ID.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

string $filter

To filter the countries by name

string $lang

Code of the language the label of the countries must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of countries

Exceptions

RestException
RestException

object getCountryByID(int $id, string $lang = '')

Get country by ID.

Parameters

int $id

ID of country

string $lang

Code of the language the name of the country must be translated to

Return Value

object

Object with cleaned properties

Exceptions

RestException
RestException

object getCountryByCode(string $code, string $lang = '')

Get country by Code.

Parameters

string $code

Code of country (2 characters)

string $lang

Code of the language the name of the country must be translated to

Return Value

object

Object with cleaned properties

Exceptions

RestException
RestException

object getCountryByISO(string $iso, string $lang = '')

Get country by Iso.

Parameters

string $iso

ISO of country (3 characters)

string $lang

Code of the language the name of the country must be translated to

Return Value

object

Object with cleaned properties

Exceptions

RestException
RestException

array getAvailability(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of delivery times.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number {@min 0}

int $active

Delivery times is active or not {@min 0} {@max 1}

string $sqlfilters

SQL criteria to filter with.

Return Value

array

[List of availability]

Exceptions

RestException
RestException
RestException

array getListOfEventTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $type = '', string $module = '', int $active = 1, string $sqlfilters = '')

Get the list of events types.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

string $type

To filter on type of event

string $module

To filter on module events

int $active

Event's type is active or not {@min 0} {@max 1}

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of events types

Exceptions

RestException
RestException

array getListOfExpenseReportsTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $module = '', int $active = 1, string $sqlfilters = '')

Get the list of Expense Report types.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

string $module

To filter on module

int $active

Event's type is active or not {@min 0} {@max 1}

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of expense report types

Exceptions

RestException
RestException

array getListOfHolidayTypes(string $sortfield = "sortorder", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $fk_country = '', int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of holiday types.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

string $fk_country

To filter on country

int $active

Holiday is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the holiday must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of holiday types

Exceptions

RestException
RestException

array getListOfPublicHolidays(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $fk_country = '', int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of public holiday.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

string $fk_country

To filter on country

int $active

Holiday is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the holiday must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of public holiday

Exceptions

RestException
RestException

array getListOfContactTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $type = '', string $module = '', int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of contacts types.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

string $type

To filter on type of contact

string $module

To filter on module contacts

int $active

Contact's type is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the civility must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of Contacts types

Exceptions

RestException
RestException

array getListOfCivilities(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $module = '', int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of civilities.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

string $module

To filter on module events

int $active

Civility is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the civility must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of civility types

Exceptions

RestException
RestException

array getListOfCurrencies(int $multicurrency = 0, string $sortfield = "code_iso", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of currencies.

Parameters

int $multicurrency

Multicurrency rates (0: no multicurrency, 1: last rate, 2: all rates) {@min 0} {@max 2}

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Payment term is active or not {@min 0} {@max 1}

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of currencies

Exceptions

RestException
RestException

array getListOfExtrafields(string $sortfield = "t.pos", string $sortorder = 'ASC', string $elementtype = '', string $sqlfilters = '')

Get the list of extra fields.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

string $elementtype

Type of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...)

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'SO-%')"

Return Value

array

List of extra fields

Exceptions

RestException
RestException

array deleteExtrafieldsFromNames(string $attrname, string $elementtype)

Delete extrafield

Parameters

string $attrname

extrafield attrname

string $elementtype

extrafield elementtype

Return Value

array

array getExtrafields(string $attrname, string $elementtype)

get Extrafield object

Parameters

string $attrname

extrafield attrname

string $elementtype

extrafield elementtype

Return Value

array

List of extra fields

int postExtrafields(string $attrname, string $elementtype, array $request_data = null)

Create Extrafield object

Parameters

string $attrname

extrafield attrname

string $elementtype

extrafield elementtype

array $request_data

Request data

Return Value

int

ID of extrafield

int updateExtrafields(string $attrname, string $elementtype, array $request_data = null)

Update Extrafield object

Parameters

string $attrname

extrafield attrname

string $elementtype

extrafield elementtype

array $request_data

Request data

Return Value

int

ID of extrafield

array getListOfTowns(string $sortfield = "zip,town", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $zipcode = '', string $town = '', int $active = 1, string $sqlfilters = '')

Get the list of towns.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

string $zipcode

To filter on zipcode

string $town

To filter on city name

int $active

Town is active or not {@min 0} {@max 1}

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of towns

Exceptions

RestException
RestException

array getPaymentTerms(string $sortfield = "sortorder", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of payments terms.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number {@min 0}

int $active

Payment term is active or not {@min 0} {@max 1}

string $sqlfilters

SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"

Return Value

array

List of payment terms

Exceptions

RestException
RestException
RestException

array getShippingModes(int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of shipping methods.

Parameters

int $limit

Number of items per page

int $page

Page number {@min 0}

int $active

Shipping methodsm is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the method must be translated to

string $sqlfilters

SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"

Return Value

array

List of shipping methods

Exceptions

RestException
RestException

array getListOfMeasuringUnits(string $sortfield = "rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of measuring units.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Measuring unit is active or not {@min 0} {@max 1}

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of measuring unit

Exceptions

RestException
RestException

array getListOfLegalForm(string $sortfield = "rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $country = 0, int $active = 1, string $sqlfilters = '')

Get the list of legal form of business.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $country

To filter on country

int $active

Lega form is active or not {@min 0} {@max 1}

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of legal form

Exceptions

RestException
RestException

array getListOfStaff(string $sortfield = "id", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of staff.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Staff is active or not {@min 0} {@max 1}

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of staff

Exceptions

RestException
RestException

array getListOfsocialNetworks(string $sortfield = "rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $sqlfilters = '')

Get the list of social networks.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Social network is active or not {@min 0} {@max 1}

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of social networks

Exceptions

RestException
RestException

array getTicketsCategories(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of tickets categories.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Payment term is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the category must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of ticket categories

Exceptions

RestException
RestException

array getTicketsSeverities(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of tickets severity.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Payment term is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the severity must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of ticket severities

Exceptions

RestException
RestException

array getTicketsTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of tickets types.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Payment term is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the type must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of ticket types

Exceptions

RestException
RestException

array getThirdpartiesTypes(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of thirdparties types.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Type is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the type must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of thirdparties types

Exceptions

RestException
RestException

array getListOfIncoterms(string $sortfield = "code", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, string $lang = '', string $sqlfilters = '')

Get the list of incoterms.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Payment term is active or not {@min 0} {@max 1}

string $lang

Code of the language the label of the type must be translated to

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of incoterm types

Exceptions

RestException

array getListOfVAT(string $sortfield = "taux", string $sortorder = 'ASC', int $limit = 100, int $page = 0, int $active = 1, int $fk_country = -1, string $sqlfilters = '')

Get the list of vat.

Parameters

string $sortfield

Sort field

string $sortorder

Sort order

int $limit

Number of items per page

int $page

Page number (starting from zero)

int $active

Vat is active or not (-1 all, 0 = inactive, 1 = active)

int $fk_country

Country of vat (if -1 we use company country, 0 = all)

string $sqlfilters

Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"

Return Value

array

List of incoterm types

Exceptions

RestException

array getCompany()

Get properties of company

Return Value

array

Mysoc object

Exceptions

RestException

array getEstablishments()

Get the list of establishments.

Return Value

array

List of establishments

Exceptions

RestException

object getEtablishmentByID(int $id)

Get establishment by ID.

Parameters

int $id

ID of establishment

Return Value

object

Object with cleaned properties

Exceptions

RestException
RestException

string getConf(string $constantname)

Get value of a setup variables

Note that conf variables that stores security key or password hashes can't be loaded with API.

Parameters

string $constantname

Name of conf variable to get

Return Value

string

Data without useless information

Exceptions

RestException
RestException

array getConfs()

Get all setup variables

Note that conf variables that stores security key or password hashes can't be loaded with API.

Return Value

array

List of establishments

Exceptions

RestException
RestException

array getCheckIntegrity(string $target)

Do a test of integrity for files and setup.

Parameters

string $target

Can be 'local' or 'default' or Url of the signatures file to use for the test. Must be reachable by the tested Dolibarr.

Return Value

array

Result of file and setup integrity check

Exceptions

RestException
RestException
RestException

array getModules()

Get list of enabled modules

Return Value

array

Data without useless information

Exceptions

RestException

array|mixed getModulesList(string $status = "active", string $origin = 'all')

Get list of modules with status and origin

Parameters

string $status

"all", "active", "disabled"

string $origin

Origin of the module (all, core, external)

Return Value

array|mixed

Data without useless information

Exceptions

RestException

array|mixed enableModules(string $modulename)

PUT enable module

Parameters

string $modulename

name of the module

Return Value

array|mixed

Data without useless information

Exceptions

RestException
RestException

array|mixed disableModules(string $modulename)

PUT enable module

Parameters

string $modulename

name of the module

Return Value

array|mixed

Data without useless information

Exceptions

RestException
RestException