Class Address

Description

(Mailing/Street) Address

Handles mapping Addresses to/from the database, along with common formatting operations on Addresses.

  • access: public

Located in /include/classes/storeable-objects/Address.inc (line 25)

StoredObject
   |
   --Address
Method Summary
 Address Address (DB $db, mixed $id)
 string getBlock ()
 string getCity ()
 string getState ()
 string getStreet1 ()
 string getStreet2 ()
 string getString ()
 string getZip ()
 boolean populateFromFormVars (array $formVars, string $prefix, boolean $tba)
 int setCity (mixed $data)
 int setState (mixed $data)
 int setStreet1 (mixed $data)
 int setStreet2 (mixed $data)
 int setZip (mixed $data)
 boolean validateInputs (array &$formVars, string $prefix, [boolean $tba = FALSE])
Variables
Methods
Constructor Address (line 36)

Address Constructor.

Registers the appropriate table from the database and attempts to retrieve the provided id if non-zero

  • access: public
Address Address (DB $db, mixed $id)
  • DB $db: the database to pull/push data from
  • mixed $id: the primary keey of the object
getBlock (line 231)

Multi-line Standard US Postal Address Format.

Formats the address along normal multi=line envelop style. Seperates lines with newlines, use a nl_2_br type function for web display.

  • return: the formatted address
  • access: public
string getBlock ()
getCity (line 204)

City Getter.

Customized Generic Getter

  • return: the referenced member variable
  • access: public
string getCity ()
getState (line 211)

State Getter.

Customized Generic Getter

  • return: the referenced member variable
  • access: public
string getState ()
getStreet1 (line 190)

Street, Line 1, Getter.

Customized Generic Getter

  • return: the referenced member variable
  • access: public
string getStreet1 ()
getStreet2 (line 197)

Street, Line 2, Getter.

Customized Generic Getter

  • return: the referenced member variable
  • access: public
string getStreet2 ()
getString (line 244)

Single-line Format.

  • return: the formatted address
  • access: public
string getString ()
getZip (line 218)

Zip Getter.

Customized Generic Getter

  • return: the referenced member variable
  • access: public
string getZip ()
populateFromFormVars (line 119)

Populate Member Variables from Form Input.

Populate the member variables from the passed in form data. Searches for a match on entered values. If a single match set the primary key and return it. Otherwise post this instance and retrieve the assigned primary key.

  • return: true if all fields valid, otherwise false
  • access: public
  • todo: Handle mutliple matches better?
boolean populateFromFormVars (array $formVars, string $prefix, boolean $tba)
  • array $formVars: the provided variables
  • string $prefix: a prefix to all array keynames for multiple form handling
  • boolean $tba: if the address is for a TBA we relax the rules
setCity (line 162)

City Setter.

Customized Generic Setter

  • var: the value to set
  • return: 1 on success, 0 on failure
  • access: public
int setCity (mixed $data)
setState (line 170)

State Setter.

Customized Generic Setter

  • var: the value to set
  • return: 1 on success, 0 on failure
  • access: public
int setState (mixed $data)
setStreet1 (line 146)

Street, Line 1, Setter.

Customized Generic Setter

  • var: the value to set
  • return: 1 on success, 0 on failure
  • access: public
int setStreet1 (mixed $data)
setStreet2 (line 154)

Street, Line 2, Setter.

Customized Generic Setter

  • var: the value to set
  • return: 1 on success, 0 on failure
  • access: public
int setStreet2 (mixed $data)
setZip (line 178)

Zip 1 Setter.

Customized Generic Setter

  • var: the value to set
  • return: 1 on success, 0 on failure
  • access: public
int setZip (mixed $data)
validateInputs (line 63)

Validate Inputs.

Validates inputs from an array against business logic rules.

  • return: true if all fields valid, otherwise false
  • access: public
boolean validateInputs (array &$formVars, string $prefix, [boolean $tba = FALSE])
  • array &$formVars: the provided variables to validate, error messages are added to the array as needed, and possibly malicious logic is escaped prior to possible DB insertion or re-display.
  • string $prefix: a prefix to all array keynames for multiple form handling
  • boolean $tba: if the address is for a TBA we relax the rules

Inherited Methods

Inherited From StoredObject

 StoredObject::StoredObject()
 StoredObject::addTable()
 StoredObject::getGeneralData()
 StoredObject::getID()
 StoredObject::getSelectByIDString()
 StoredObject::insertNew()
 StoredObject::postToDB()
 StoredObject::remove()
 StoredObject::removeTable()
 StoredObject::retrieve()
 StoredObject::searchDB()
 StoredObject::setGeneralData()
 StoredObject::setID()
 StoredObject::update()

Documentation generated on Tue, 25 Apr 2006 12:58:23 -0400 by phpDocumentor 1.3.0RC3