dolibarr  20.0.0-beta
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Setup Class Reference
Inheritance diagram for Setup:
Inheritance graph
[legend]
Collaboration diagram for Setup:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 Constructor.
 
 getOrderingMethods ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $active=1, $sqlfilters='')
 Get the list of ordering methods. More...
 
 getOrderingOrigins ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $active=1, $sqlfilters='')
 Get the list of ordering origins. More...
 
 getPaymentTypes ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $active=1, $sqlfilters='')
 Get the list of payments types. More...
 
 getListOfRegions ($sortfield="code_region", $sortorder='ASC', $limit=100, $page=0, $country=0, $filter='', $sqlfilters='')
 Get the list of regions. More...
 
 getRegionByID ($id)
 Get region by ID. More...
 
 getRegionByCode ($code)
 Get region by Code. More...
 
 getListOfStates ($sortfield="code_departement", $sortorder='ASC', $limit=100, $page=0, $country=0, $filter='', $sqlfilters='')
 Get the list of states/provinces. More...
 
 getStateByID ($id)
 Get state by ID. More...
 
 getStateByCode ($code)
 Get state by Code. More...
 
 getListOfCountries ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $filter='', $lang='', $sqlfilters='')
 Get the list of countries. More...
 
 getCountryByID ($id, $lang='')
 Get country by ID. More...
 
 getCountryByCode ($code, $lang='')
 Get country by Code. More...
 
 getCountryByISO ($iso, $lang='')
 Get country by Iso. More...
 
 getAvailability ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $active=1, $sqlfilters='')
 Get the list of delivery times. More...
 
 getListOfEventTypes ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $type='', $module='', $active=1, $sqlfilters='')
 Get the list of events types. More...
 
 getListOfExpenseReportsTypes ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $module='', $active=1, $sqlfilters='')
 Get the list of Expense Report types. More...
 
 getListOfContactTypes ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $type='', $module='', $active=1, $lang='', $sqlfilters='')
 Get the list of contacts types. More...
 
 getListOfCivilities ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $module='', $active=1, $lang='', $sqlfilters='')
 Get the list of civilities. More...
 
 getListOfCurrencies ($multicurrency=0, $sortfield="code_iso", $sortorder='ASC', $limit=100, $page=0, $active=1, $sqlfilters='')
 Get the list of currencies. More...
 
 getListOfExtrafields ($sortfield="t.pos", $sortorder='ASC', $elementtype='', $sqlfilters='')
 Get the list of extra fields. More...
 
 deleteExtrafieldsFromNames ($attrname, $elementtype)
 Delete extrafield. More...
 
 getExtrafields ($attrname, $elementtype)
 get Extrafield object More...
 
 postExtrafields ($attrname, $elementtype, $request_data=null)
 Create Extrafield object. More...
 
 updateExtrafields ($attrname, $elementtype, $request_data=null)
 Update Extrafield object. More...
 
 getListOfTowns ($sortfield="zip,town", $sortorder='ASC', $limit=100, $page=0, $zipcode='', $town='', $active=1, $sqlfilters='')
 Get the list of towns. More...
 
 getPaymentTerms ($sortfield="sortorder", $sortorder='ASC', $limit=100, $page=0, $active=1, $sqlfilters='')
 Get the list of payments terms. More...
 
 getShippingModes ($limit=100, $page=0, $active=1, $lang='', $sqlfilters='')
 Get the list of shipping methods. More...
 
 getListOfMeasuringUnits ($sortfield="rowid", $sortorder='ASC', $limit=100, $page=0, $active=1, $sqlfilters='')
 Get the list of measuring units. More...
 
 getListOfLegalForm ($sortfield="rowid", $sortorder='ASC', $limit=100, $page=0, $country=0, $active=1, $sqlfilters='')
 Get the list of legal form of business. More...
 
 getListOfStaff ($sortfield="id", $sortorder='ASC', $limit=100, $page=0, $active=1, $sqlfilters='')
 Get the list of staff. More...
 
 getListOfsocialNetworks ($sortfield="rowid", $sortorder='ASC', $limit=100, $page=0, $active=1, $sqlfilters='')
 Get the list of social networks. More...
 
 getTicketsCategories ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $active=1, $lang='', $sqlfilters='')
 Get the list of tickets categories. More...
 
 getTicketsSeverities ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $active=1, $lang='', $sqlfilters='')
 Get the list of tickets severity. More...
 
 getTicketsTypes ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $active=1, $lang='', $sqlfilters='')
 Get the list of tickets types. More...
 
 getListOfIncoterms ($sortfield="code", $sortorder='ASC', $limit=100, $page=0, $active=1, $lang='', $sqlfilters='')
 Get the list of incoterms. More...
 
 getCompany ()
 Get properties of company. More...
 
 getEstablishments ()
 Get the list of establishments. More...
 
 getEtablishmentByID ($id)
 Get establishment by ID. More...
 
 getConf ($constantname)
 Get value of a setup variables. More...
 
 getCheckIntegrity ($target)
 Do a test of integrity for files and setup. More...
 
 getModules ()
 Get list of enabled modules. More...
 
- Public Member Functions inherited from DolibarrApi
 __construct ($db, $cachedir='', $refreshCache=false)
 Constructor. More...
 

Protected Member Functions

 _cleanObjectDatas ($object)
 Clean sensible object datas. More...
 
- Protected Member Functions inherited from DolibarrApi
 _checkValForAPI ($field, $value, $object)
 Check and convert a string depending on its type/name. More...
 
 _filterObjectProperties ($object, $properties)
 Filter properties that will be returned on object. More...
 
 _checkFilters ($sqlfilters, &$error='')
 Return if a $sqlfilters parameter is valid Function no more used. More...
 

Private Member Functions

 _fetchCregion ($id, $code='')
 Get region. More...
 
 _fetchCstate ($id, $code='')
 Get state. More...
 
 _fetchCcountry ($id, $code='', $iso='', $lang='')
 Get country. More...
 
 translateLabel ($object, $lang, $prefix='Country', $dict=array('dict'))
 Translate the name of the object to the given language. More...
 

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. More...
 
static _forge_criteria_callback ($matches)
 Function to forge a SQL criteria from a Generic filter string. More...
 

Detailed Description

Definition at line 40 of file api_setup.class.php.

Member Function Documentation

◆ _cleanObjectDatas()

Setup::_cleanObjectDatas (   $object)
protected

Clean sensible object datas.

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

Reimplemented from DolibarrApi.

Definition at line 732 of file api_setup.class.php.

References $object.

◆ _fetchCcountry()

Setup::_fetchCcountry (   $id,
  $code = '',
  $iso = '',
  $lang = '' 
)
private

Get country.

Parameters
int$idID of country
string$codeCode of country (2 characters)
string$isoISO of country (3 characters)
string$langCode of the language the name of the country must be translated to
Returns
Object Object with cleaned properties
Exceptions
RestException

Definition at line 643 of file api_setup.class.php.

◆ _fetchCregion()

Setup::_fetchCregion (   $id,
  $code = '' 
)
private

Get region.

Parameters
int$idID of region
string$codeCode of region
Returns
Object Object with cleaned properties
Exceptions
RestException

Definition at line 595 of file api_setup.class.php.

◆ _fetchCstate()

Setup::_fetchCstate (   $id,
  $code = '' 
)
private

Get state.

Parameters
int$idID of state
string$codeCode of state
Returns
Object Object with cleaned properties
Exceptions
RestException

Definition at line 618 of file api_setup.class.php.

◆ deleteExtrafieldsFromNames()

Setup::deleteExtrafieldsFromNames (   $attrname,
  $elementtype 
)

Delete extrafield.

Parameters
string$attrnameextrafield attrname
string$elementtypeextrafield elementtype
Returns
array

@url DELETE extrafields/{elementtype}/{attrname}

Definition at line 1211 of file api_setup.class.php.

◆ getAvailability()

Setup::getAvailability (   $sortfield = "code",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $active = 1,
  $sqlfilters = '' 
)

Get the list of delivery times.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number {@min 0}
int$activeDelivery times is active or not {@min 0} {@max 1}
string$sqlfiltersSQL criteria to filter with.

@url GET dictionary/availability

Returns
array [List of availability]
Exceptions
RestException400 Bad value for sqlfilters
RestException403 Access denied
RestException503 Error when retrieving list of availabilities

Definition at line 678 of file api_setup.class.php.

◆ getCheckIntegrity()

Setup::getCheckIntegrity (   $target)

Do a test of integrity for files and setup.

Parameters
string$targetCan be 'local' or 'default' or Url of the signatures file to use for the test. Must be reachable by the tested Dolibarr.
Returns
array Result of file and setup integrity check

@url GET checkintegrity

Exceptions
RestException403 Forbidden
RestException404 Signature file not found
RestException500 Technical error

Definition at line 2342 of file api_setup.class.php.

◆ getCompany()

Setup::getCompany ( )

Get properties of company.

@url GET /company

Returns
array|mixed Mysoc object
Exceptions
RestException403 Forbidden

Definition at line 2190 of file api_setup.class.php.

◆ getConf()

Setup::getConf (   $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$constantnameName of conf variable to get
Returns
string Data without useless information

@url GET conf/{constantname}

Exceptions
RestException400 Error Bad or unknown value for constantname
RestException403 Forbidden

Definition at line 2311 of file api_setup.class.php.

◆ getCountryByCode()

Setup::getCountryByCode (   $code,
  $lang = '' 
)

Get country by Code.

Parameters
string$codeCode of country (2 characters)
string$langCode of the language the name of the country must be translated to
Returns
Object Object with cleaned properties

@url GET dictionary/countries/byCode/{code}

Exceptions
RestException404 Country not found
RestException503 Error retrieving country

Definition at line 564 of file api_setup.class.php.

◆ getCountryByID()

Setup::getCountryByID (   $id,
  $lang = '' 
)

Get country by ID.

Parameters
int$idID of country
string$langCode of the language the name of the country must be translated to
Returns
Object Object with cleaned properties

@url GET dictionary/countries/{id}

Exceptions
RestException404 Country not found
RestException503 Error retrieving country

Definition at line 547 of file api_setup.class.php.

◆ getCountryByISO()

Setup::getCountryByISO (   $iso,
  $lang = '' 
)

Get country by Iso.

Parameters
string$isoISO of country (3 characters)
string$langCode of the language the name of the country must be translated to
Returns
Object Object with cleaned properties

@url GET dictionary/countries/byISO/{iso}

Exceptions
RestException404 Country not found
RestException503 Error retrieving country

Definition at line 581 of file api_setup.class.php.

◆ getEstablishments()

Setup::getEstablishments ( )

Get the list of establishments.

Returns
array List of establishments

@url GET /establishments

Exceptions
RestException503 Error when retrieving list of establishments

Definition at line 2245 of file api_setup.class.php.

◆ getEtablishmentByID()

Setup::getEtablishmentByID (   $id)

Get establishment by ID.

Parameters
int$idID of establishment
Returns
Object Object with cleaned properties

@url GET establishments/{id}

Exceptions
RestException404 Establishment not found
RestException503 Error when retrieving establishment

Definition at line 2284 of file api_setup.class.php.

◆ getExtrafields()

Setup::getExtrafields (   $attrname,
  $elementtype 
)

get Extrafield object

Parameters
string$attrnameextrafield attrname
string$elementtypeextrafield elementtype
Returns
array List of extra fields

@url GET extrafields/{elementtype}/{attrname}

@suppress PhanPluginUnknownArrayMethodParamType Luracast limitation

Definition at line 1249 of file api_setup.class.php.

◆ getListOfCivilities()

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

Get the list of civilities.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
string$moduleTo filter on module events
int$activeCivility is active or not {@min 0} {@max 1}
string$langCode of the language the label of the civility must be translated to
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of civility types

@url GET dictionary/civilities

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of civilities

Definition at line 993 of file api_setup.class.php.

◆ getListOfContactTypes()

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

Get the list of contacts types.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
string$typeTo filter on type of contact
string$moduleTo filter on module contacts
int$activeContact's type is active or not {@min 0} {@max 1}
string$langCode of the language the label of the civility must be translated to
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of Contacts types

@url GET dictionary/contact_types

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of contacts types

Definition at line 924 of file api_setup.class.php.

◆ getListOfCountries()

Setup::getListOfCountries (   $sortfield = "code",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $filter = '',
  $lang = '',
  $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$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
string$filterTo filter the countries by name
string$langCode of the language the label of the countries must be translated to
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of countries

@url GET dictionary/countries

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error retrieving list of countries

Definition at line 482 of file api_setup.class.php.

◆ getListOfCurrencies()

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

Get the list of currencies.

Parameters
int$multicurrencyMulticurrency rates (0: no multicurrency, 1: last rate, 2: all rates) {@min 0} {@max 2}
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$activePayment term is active or not {@min 0} {@max 1}
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of currencies

@url GET dictionary/currencies

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of currencies

Definition at line 1058 of file api_setup.class.php.

◆ getListOfEventTypes()

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

Get the list of events types.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
string$typeTo filter on type of event
string$moduleTo filter on module events
int$activeEvent's type is active or not {@min 0} {@max 1}
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of events types

@url GET dictionary/event_types

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of events types

Definition at line 791 of file api_setup.class.php.

◆ getListOfExpenseReportsTypes()

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

Get the list of Expense Report types.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
string$moduleTo filter on module
int$activeEvent's type is active or not {@min 0} {@max 1}
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of expense report types

@url GET dictionary/expensereport_types

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of expense report types

Definition at line 858 of file api_setup.class.php.

◆ getListOfExtrafields()

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

Get the list of extra fields.

Parameters
string$sortfieldSort field
string$sortorderSort order
string$elementtypeType of element ('adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...)
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.label:like:'SO-%')"
Returns
array List of extra fields

@url GET extrafields

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of extra fields

Definition at line 1128 of file api_setup.class.php.

◆ getListOfIncoterms()

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

Get the list of incoterms.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$activePayment term is active or not {@min 0} {@max 1}
string$langCode of the language the label of the type must be translated to
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of incoterm types

@url GET dictionary/incoterms

Exceptions
RestException503 Error when retrieving list of incoterms types

Definition at line 2135 of file api_setup.class.php.

◆ getListOfLegalForm()

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

Get the list of legal form of business.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$countryTo filter on country
int$activeLega form is active or not {@min 0} {@max 1}
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of legal form

@url GET dictionary/legal_form

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of legal form

Definition at line 1758 of file api_setup.class.php.

◆ getListOfMeasuringUnits()

Setup::getListOfMeasuringUnits (   $sortfield = "rowid",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $active = 1,
  $sqlfilters = '' 
)

Get the list of measuring units.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$activeMeasuring unit is active or not {@min 0} {@max 1}
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of measuring unit

@url GET dictionary/units

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of measuring units

Definition at line 1698 of file api_setup.class.php.

◆ getListOfRegions()

Setup::getListOfRegions (   $sortfield = "code_region",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $country = 0,
  $filter = '',
  $sqlfilters = '' 
)

Get the list of regions.

The returned list is sorted by region ID.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$countryTo filter on country
string$filterTo filter the regions by name
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of regions

@url GET dictionary/regions

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error retrieving list of regions

Definition at line 266 of file api_setup.class.php.

◆ getListOfsocialNetworks()

Setup::getListOfsocialNetworks (   $sortfield = "rowid",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $active = 1,
  $sqlfilters = '' 
)

Get the list of social networks.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$activeSocial network is active or not {@min 0} {@max 1}
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of social networks

@url GET dictionary/socialnetworks

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of social networks

Definition at line 1879 of file api_setup.class.php.

◆ getListOfStaff()

Setup::getListOfStaff (   $sortfield = "id",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $active = 1,
  $sqlfilters = '' 
)

Get the list of staff.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$activeStaff is active or not {@min 0} {@max 1}
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of staff

@url GET dictionary/staff

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of staff

Definition at line 1820 of file api_setup.class.php.

◆ getListOfStates()

Setup::getListOfStates (   $sortfield = "code_departement",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $country = 0,
  $filter = '',
  $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$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$countryTo filter on country
string$filterTo filter the states by name
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of states

@url GET dictionary/states

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error retrieving list of states

Definition at line 373 of file api_setup.class.php.

◆ getListOfTowns()

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

Get the list of towns.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
string$zipcodeTo filter on zipcode
string$townTo filter on city name
int$activeTown is active or not {@min 0} {@max 1}
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of towns

@url GET dictionary/towns

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of towns

Definition at line 1505 of file api_setup.class.php.

◆ getModules()

Setup::getModules ( )

Get list of enabled modules.

@url GET /modules

Returns
array|mixed Data without useless information
Exceptions
RestException403 Forbidden

Definition at line 2660 of file api_setup.class.php.

◆ getOrderingMethods()

Setup::getOrderingMethods (   $sortfield = "code",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $active = 1,
  $sqlfilters = '' 
)

Get the list of ordering methods.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number {@min 0}
int$activePayment type is active or not {@min 0} {@max 1}
string$sqlfiltersSQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"

@url GET dictionary/ordering_methods

Returns
array [List of ordering methods]
Exceptions
RestException400 Bad value for sqlfilters
RestException403 Access denied
RestException503 Error retrieving list of ordering methods

Definition at line 71 of file api_setup.class.php.

◆ getOrderingOrigins()

Setup::getOrderingOrigins (   $sortfield = "code",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $active = 1,
  $sqlfilters = '' 
)

Get the list of ordering origins.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number {@min 0}
int$activePayment type is active or not {@min 0} {@max 1}
string$sqlfiltersSQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"
Returns
array [List of ordering reasons]

@url GET dictionary/ordering_origins

Exceptions
RestException400 Bad value for sqlfilters
RestException403 Access denied
RestException503 Error retrieving list of ordering origins

Definition at line 135 of file api_setup.class.php.

◆ getPaymentTerms()

Setup::getPaymentTerms (   $sortfield = "sortorder",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $active = 1,
  $sqlfilters = '' 
)

Get the list of payments terms.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number {@min 0}
int$activePayment term is active or not {@min 0} {@max 1}
string$sqlfiltersSQL criteria to filter. Syntax example "(t.code:=:'CHQ')"

@url GET dictionary/payment_terms

Returns
array List of payment terms
Exceptions
RestException400 Bad value for sqlfilters
RestException403 Access denied
RestException503 Error when retrieving list of payments terms

Definition at line 1572 of file api_setup.class.php.

◆ getPaymentTypes()

Setup::getPaymentTypes (   $sortfield = "code",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $active = 1,
  $sqlfilters = '' 
)

Get the list of payments types.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number {@min 0}
int$activePayment type is active or not {@min 0} {@max 1}
string$sqlfiltersSQL criteria to filter with. Syntax example "(t.code:=:'CHQ')"

@url GET dictionary/payment_types

Returns
array [List of payment types]
Exceptions
RestException400 Bad value for sqlfilters
RestException403 Access denied
RestException503 Error retrieving list of payment types

Definition at line 200 of file api_setup.class.php.

◆ getRegionByCode()

Setup::getRegionByCode (   $code)

Get region by Code.

Parameters
string$codeCode of region
Returns
Object Object with cleaned properties

@url GET dictionary/regions/byCode/{code}

Exceptions
RestException404 Region not found
RestException503 Error when retrieving region

Definition at line 346 of file api_setup.class.php.

◆ getRegionByID()

Setup::getRegionByID (   $id)

Get region by ID.

Parameters
int$idID of region
Returns
Object Object with cleaned properties

@url GET dictionary/regions/{id}

Exceptions
RestException404 Region not found
RestException503 Error retrieving region

Definition at line 330 of file api_setup.class.php.

◆ getShippingModes()

Setup::getShippingModes (   $limit = 100,
  $page = 0,
  $active = 1,
  $lang = '',
  $sqlfilters = '' 
)

Get the list of shipping methods.

Parameters
int$limitNumber of items per page
int$pagePage number {@min 0}
int$activeShipping methodsm is active or not {@min 0} {@max 1}
string$langCode of the language the label of the method must be translated to
string$sqlfiltersSQL criteria to filter. Syntax example "(t.code:=:'CHQ')"

@url GET dictionary/shipping_methods

Returns
array List of shipping methods
Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of shipping modes

Definition at line 1636 of file api_setup.class.php.

◆ getStateByCode()

Setup::getStateByCode (   $code)

Get state by Code.

Parameters
string$codeCode of state
Returns
Object Object with cleaned properties

@url GET dictionary/states/byCode/{code}

Exceptions
RestException404 State not found
RestException503 Error retrieving state

Definition at line 455 of file api_setup.class.php.

◆ getStateByID()

Setup::getStateByID (   $id)

Get state by ID.

Parameters
int$idID of state
Returns
Object Object with cleaned properties

@url GET dictionary/states/{id}

Exceptions
RestException404 State not found
RestException503 Error retrieving state

Definition at line 439 of file api_setup.class.php.

◆ getTicketsCategories()

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

Get the list of tickets categories.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$activePayment term is active or not {@min 0} {@max 1}
string$langCode of the language the label of the category must be translated to
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of ticket categories

@url GET dictionary/ticket_categories

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of tickets categories

Definition at line 1946 of file api_setup.class.php.

◆ getTicketsSeverities()

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

Get the list of tickets severity.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$activePayment term is active or not {@min 0} {@max 1}
string$langCode of the language the label of the severity must be translated to
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of ticket severities

@url GET dictionary/ticket_severities

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of tickets severities

Definition at line 2009 of file api_setup.class.php.

◆ getTicketsTypes()

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

Get the list of tickets types.

Parameters
string$sortfieldSort field
string$sortorderSort order
int$limitNumber of items per page
int$pagePage number (starting from zero)
int$activePayment term is active or not {@min 0} {@max 1}
string$langCode of the language the label of the type must be translated to
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
array List of ticket types

@url GET dictionary/ticket_types

Exceptions
RestException400 Bad value for sqlfilters
RestException503 Error when retrieving list of tickets types

Definition at line 2072 of file api_setup.class.php.

◆ postExtrafields()

Setup::postExtrafields (   $attrname,
  $elementtype,
  $request_data = null 
)

Create Extrafield object.

Parameters
string$attrnameextrafield attrname
string$elementtypeextrafield elementtype
array$request_dataRequest datas
Returns
int ID of extrafield

@url POST extrafields/{elementtype}/{attrname}

@suppress PhanPluginUnknownArrayMethodParamType Luracast limitation

Definition at line 1326 of file api_setup.class.php.

◆ translateLabel()

Setup::translateLabel (   $object,
  $lang,
  $prefix = 'Country',
  $dict = array('dict') 
)
private

Translate the name of the object to the given language.

Parameters
object$objectObject with label to translate
string$langCode of the language the name of the object must be translated to
string$prefixPrefix for translation key
array$dictArray of dictionary for translation
Returns
void

Definition at line 752 of file api_setup.class.php.

◆ updateExtrafields()

Setup::updateExtrafields (   $attrname,
  $elementtype,
  $request_data = null 
)

Update Extrafield object.

Parameters
string$attrnameextrafield attrname
string$elementtypeextrafield elementtype
array$request_dataRequest datas
Returns
int ID of extrafield

@url PUT extrafields/{elementtype}/{attrname}

@suppress PhanPluginUnknownArrayMethodParamType Luracast limitation

Definition at line 1415 of file api_setup.class.php.


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