68 Classifieds API

Features
class tree: 68Classifieds | index: 68Classifieds | all elements

 Class Countries

Description

Manipulates the countries table, all functions can be accessed statically, i.e. Countries::getCountries(); and no constructor is necessary.

Located in /includes/classes/kernel/Countries.php (line 18)


	
			
Method Summary
 mixed deleteCountry (string $identifier, mixed $value)
 mixed filterCountryData (array $data)
 mixed getCountries ()
 mixed getCountryCode (string $identifier, mixed $value)
 mixed getCountryId (string $identifier, string $value)
 mixed getCountryName (string $identifier, mixed $value)
 mixed insertCountry (array $data, [boolan $filter = true])
 boolean maintenanceStates ()
 boolean resetCountries ()
 mixed selectCountries ()
 mixed selectCountry (string $identifier, mixed $value)
 mixed updateCountry (array $data, [boolan $filter = true])
Methods
deleteCountry (line 344)

Delete a country - will only delete 1 row, even if multiple rows exist such as when deleting by the code identifier.

  • return: false on failure integer (affected rows) on success
  • access: public
mixed deleteCountry (string $identifier, mixed $value)
  • string $identifier
  • mixed $value: name/code=string id=integer
filterCountryData (line 161)

Filter country data, removes html tags, converts to entities, and enforces utf8 data for all variables in $data if it isn't an integer.

  • return: false on empty param, array of filtered variables
  • access: public
mixed filterCountryData (array $data)
  • array $data
getCountries (line 27)

Gets all country names in descending order by rank, assending order by name

  • return: false for db error array of country names on success
  • access: public
  • usedby: Users::getCountries()
mixed getCountries ()
getCountryCode (line 93)

Get a country's code by id or name

  • return: false on failure, string for 1 match
  • access: public
mixed getCountryCode (string $identifier, mixed $value)
  • string $identifier: id or name
  • mixed $value: id=integer value=string
getCountryId (line 121)

Get a country's id by name or code

  • return: false on failure, string for 1 match, array on >1 match
  • access: public
mixed getCountryId (string $identifier, string $value)
  • string $identifier: name or code
  • string $value
getCountryName (line 54)

Get a country's name, by id or code.

  • return: false on failure string on success
  • access: public
mixed getCountryName (string $identifier, mixed $value)
  • string $identifier: id or code
  • mixed $value: id=integer code=string
insertCountry (line 282)

Insert data for a new country

  • return: false on failure or integer (id) on success
  • access: public
mixed insertCountry (array $data, [boolan $filter = true])
  • array $data
  • boolan $filter: default=true if true data is filtered
maintenanceStates (line 626)

Repair and optimize the countries table

  • access: public
boolean maintenanceStates ()
resetCountries (line 372)

Reset the countries table to its installation state

  • access: public
boolean resetCountries ()
selectCountries (line 184)

Selects all fields for each country in table

  • return: false on failure or array of country data
  • access: public
mixed selectCountries ()
selectCountry (line 238)

Select a single country, returns all fields

  • return: false on failure, array of fields for 1 match, array of field arrays for >1 match
  • access: public
mixed selectCountry (string $identifier, mixed $value)
  • string $identifier: name,code,or id
  • mixed $value: name/code=string id=integer
selectEnabledCountries (line 210)

Selects all fields for each enabled country in table

  • return: false on failure or array of country data
  • access: public
mixed selectEnabledCountries ()
updateCountry (line 312)

Update data for a country

  • return: false on failure or integer (rows affected) on success
  • access: public
mixed updateCountry (array $data, [boolan $filter = true])
  • array $data
  • boolan $filter: default=true if true data is filtered