Class As_Query

Description

Base class used by the insert, update, select classes.

  • author: Anthony Bush

Located in /as_query/As_Query.class.php (line 9)


	
			
Direct descendents
Class Description
As_InsertQuery Insert specific query
As_SelectQuery A simple SQL query object for SELECT statements.
Variable Summary
mixed $db
Method Summary
static void getInsertQuery ( $db)
static void getSelectQuery ( $db)
static void getUpdateQuery ( $db)
As_Query __construct ([ $db = null])
void add ( $stringOrArray,  &$dest,  $delim)
string buildWhereSql ( $where)
void execute ()
string getEqualityOperatorFromValue ( $fieldValue)
void getString ()
void remapCriteria ( $criteria)
void run ()
void setDb ( $db)
void __toString ()
Variables
mixed $db = null (line 11)
  • access: protected
Methods
static method getInsertQuery (line 184)
  • access: public
static void getInsertQuery ( $db)
  • $db
static method getSelectQuery (line 178)
  • access: public
static void getSelectQuery ( $db)
  • $db
static method getUpdateQuery (line 190)
  • access: public
static void getUpdateQuery ( $db)
  • $db
Constructor __construct (line 17)

Pass in a database object that provides a quote() method.

Will be used to quote WHERE conditions.

  • access: public
As_Query __construct ([ $db = null])
  • $db
add (line 54)

Adds $stringOrArray to $dest using $delin as a separator.

  • author: Anthony Bush
  • access: protected
void add ( $stringOrArray,  &$dest,  $delim)
  • $stringOrArray
  • &$dest
  • $delim
buildWhereSql (line 140)

builds a WHERE clause from the supplied array

  • author: Lewis Zhang, Anthony Bush
  • throws: Exception
  • access: public
string buildWhereSql ( $where)
  • $where
execute (line 43)
  • access: public
void execute ()
getEqualityOperatorFromValue (line 166)

returns the proper equality operator from the value being tested

  • author: Lewis Zhang
  • access: public
string getEqualityOperatorFromValue ( $fieldValue)
  • $fieldValue
getString (line 33)
  • access: public
void getString ()

Redefined in descendants as:
remapCriteria (line 106)

Re-map the given array to allow for multiple formats.

Format 1: Pre-quoted values with pre-filled equators:

array( 'some_field = "some_value"', 'some_other_field = "some_other_value"' )

Format 2: Non-quoted values with no equators:

array( 'some_field' => 'some_value', 'some_other_field' => 'some_other_value' )

Format 3: Mixed of the above two.

array( 'some_field = "some_value"', 'some_other_field' => 'some_other_value' )

  • author: Anthony Bush
  • access: protected
void remapCriteria ( $criteria)
  • $criteria
run (line 38)
  • access: public
void run ()
setDb (line 22)
  • access: public
void setDb ( $db)
  • $db
__toString (line 27)
  • access: public
void __toString ()

Documentation generated on Sun, 19 Oct 2008 11:56:29 -0500 by phpDocumentor 1.4.0