68 Classifieds API

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

 Class States

Description

Manipulates the states table, all functions can be accessed statically, i.e. States::getStates(); and no constructor is necessary.

Located in /includes/classes/kernel/States.php (line 17)


	
			
Method Summary
 mixed deleteState (string $identifier, mixed $value)
 mixed filterStateData (array $data)
 mixed getStateAbbrev (string $identifier, mixed $value)
 mixed getStateId (string $identifier, string $value)
 mixed getStateName (string $identifier, mixed $value)
 mixed getStates ()
 mixed insertState (array $data, [boolan $filter = true])
 boolean maintenanceStates ()
 boolean resetStates ()
 mixed selectState (string $identifier, mixed $value)
 mixed selectStates ()
 mixed updateState (array $data, [boolan $filter = true])
Methods
deleteState (line 296)

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

  • return: false on failure integer (affected rows) on success
  • access: public
mixed deleteState (string $identifier, mixed $value)
  • string $identifier
  • mixed $value: name/abbrev=string id=integer
filterStateData (line 147)

Filter state 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 filterStateData (array $data)
  • array $data
getStateAbbrev (line 80)

Get a state's abbreviation by id or name

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

Get a state's id by name or abbrev

  • return: false on failure, string for 1 match, array on >1 match
  • access: public
mixed getStateId (string $identifier, string $value)
  • string $identifier: name or abbrev
  • string $value
getStateName (line 53)

Get a state's name, by id or abbreviation.

  • return: false on failure string on success
  • access: public
mixed getStateName (string $identifier, mixed $value)
  • string $identifier: id or abbrev
  • mixed $value: id=integer abbrev=string
getStates (line 26)

Gets all state names in ascending order

  • return: false for db error array of state names on success
  • access: public
  • usedby: Users::getStates()
mixed getStates ()
insertState (line 240)

Insert data for a new state

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

Repair and optimize the states table

  • access: public
boolean maintenanceStates ()
resetStates (line 323)

Reset the states table to its installation state

  • access: public
boolean resetStates ()
selectState (line 197)

Select a single state, returns all fields

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

Selects all fields for each state in table

  • return: false on failure or array of state data
  • access: public
mixed selectStates ()
updateState (line 267)

Update data for a state

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