Setup
class Setup extends DolibarrApi (View source)
API class for dictionaries
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi |
Methods
Constructor
Check and convert a string depending on its type/name.
Filter properties that will be returned on object
Clean sensible object datas
Check access by user to a given resource
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
Function to forge a SQL criteria from a Generic filter string.
Get the list of Action Triggers.
Get the list of ordering methods.
Get the list of ordering origins.
Get the list of payments types.
Get the list of regions.
Get region by ID.
Get region by Code.
Get the list of states/provinces.
Get state by ID.
Get state by Code.
Get the list of countries.
Get country by ID.
Get country by Code.
Get country by Iso.
Get the list of delivery times.
Get the list of events types.
Get the list of Expense Report types.
Get the list of holiday types.
Get the list of public holiday.
Get the list of contacts types.
Get the list of civilities.
Get the list of currencies.
Get the list of extra fields.
Delete extrafield
get Extrafield object
Create Extrafield object
Update Extrafield object
Get the list of towns.
Get the list of payments terms.
Get the list of shipping methods.
Get the list of measuring units.
Get the list of legal form of business.
Get the list of staff.
Get the list of social networks.
Get the list of tickets categories.
Get the list of tickets severity.
Get the list of tickets types.
Get the list of thirdparties types.
Get the list of incoterms.
Get the list of vat.
Get properties of company
Get the list of establishments.
Get establishment by ID.
Get value of a setup variables
Get all setup variables
Do a test of integrity for files and setup.
Get list of enabled modules
Get list of modules with status and origin
PUT enable module
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.
protected object
_filterObjectProperties(object $object, string $properties)
Filter properties that will be returned on object
protected object
_cleanObjectDatas(object $object)
Clean sensible object datas
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
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
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
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.
The returned list is sorted by region ID.
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.
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.
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.
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.
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
Note that conf variables that stores security key or password hashes can't be loaded with API.
array
getConfs()
Get all setup variables
Note that conf variables that stores security key or password hashes can't be loaded with API.
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