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

Public Member Functions

 __construct ()
 Constructor.
 
 getPaymentTypes ($sortfield="code", $sortorder= 'ASC', $limit=100, $page=0, $active=1, $sqlfilters= '')
 Get the list of payments types. 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...
 
 getAvailability ($sortfield="code", $sortorder= 'ASC', $limit=100, $page=0, $active=1, $sqlfilters= '')
 Get the list of delivery times. More...
 
 _cleanObjectDatas ($object)
 Clean sensible object datas. More...
 
 getListOfEventTypes ($sortfield="code", $sortorder= 'ASC', $limit=100, $page=0, $type= '', $module= '', $sqlfilters= '')
 Get the list of events types. More...
 
 getListOfExtrafields ($sortfield="t.pos", $sortorder= 'ASC', $type= '', $sqlfilters= '')
 Get the list of extra fields. More...
 
 getListOfTowns ($sortfield="zip,town", $sortorder= 'ASC', $limit=100, $page=0, $zipcode= '', $town= '', $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...
 
 getCheckIntegrity ($target)
 Do a test of integrity for files and setup. 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...
 

Private Member Functions

 translateLabel ($country, $lang)
 Translate the name of the country to the given language. More...
 

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 33 of file api_setup.class.php.

Member Function Documentation

Setup::_cleanObjectDatas (   $object)

Clean sensible object datas.

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

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

Referenced by getCountryByID(), and getListOfCountries().

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 { 0}
int$activeDelivery times is active or not { 0} { 1}
string$sqlfiltersSQL criteria to filter with.

GET dictionary/availability

Returns
array [List of availability]
Exceptions
400RestException
200OK

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

References DolibarrApi\_checkFilters().

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
Result of file and setup integrity check

GET checkintegrity

Exceptions
RestException

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

References dol_dir_list(), dol_filemtime(), dol_filesize(), dol_is_file(), dol_sort_array(), getFilesUpdated(), GETPOST(), getURLContent(), if, and load_fiche_titre().

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

GET dictionary/countries/{id}

Exceptions
RestException

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

References _cleanObjectDatas(), and translateLabel().

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
List of countries

GET dictionary/countries

Exceptions
RestException

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

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

Setup::getListOfEventTypes (   $sortfield = "code",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $type = '',
  $module = '',
  $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
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
List of events types

GET dictionary/event_types

Exceptions
RestException

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

References DolibarrApi\_checkFilters().

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

Get the list of extra fields.

Parameters
string$sortfieldSort field
string$sortorderSort order
string$typeType 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
List of events types

GET extrafields

Exceptions
RestException

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

References $resql, and DolibarrApi\_checkFilters().

Setup::getListOfTowns (   $sortfield = "zip,town",
  $sortorder = 'ASC',
  $limit = 100,
  $page = 0,
  $zipcode = '',
  $town = '',
  $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
string$sqlfiltersOther criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
Returns
List of towns

GET dictionary/towns

Exceptions
RestException

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

References DolibarrApi\_checkFilters().

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 { 0}
int$activePayment term is active or not { 0} { 1}
string$sqlfiltersSQL criteria to filter. Syntax example "(t.code:=:'CHQ')"

GET dictionary/payment_terms

Returns
array List of payment terms
Exceptions
400RestException
200OK

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

References DolibarrApi\_checkFilters().

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 { 0}
int$activePayment type is active or not { 0} { 1}
string$sqlfiltersSQL criteria to filter with. Syntax example "(t.code:=:'CHQ')"

GET dictionary/payment_types

Returns
array [List of payment types]
Exceptions
400RestException
200OK

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

References DolibarrApi\_checkFilters().

Setup::translateLabel (   $country,
  $lang 
)
private

Translate the name of the country to the given language.

Parameters
Ccountry$countryCountry
string$langCode of the language the name of the country must be translated to

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

Referenced by getCountryByID(), and getListOfCountries().


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