Class UpdateQuery

Description

Implements interfaces:

An UpdateQuery class provides the tools to build an UPDATE query.

Located in /harmoni/core/DBHandler/UpdateQuery.class.php (line 25)

SObject
   |
   --QueryAbstract
      |
      --UpdateQuery
Variable Summary
array $_columns
array $_condition
string $_table
array $_values
Method Summary
UpdateQuery UpdateQuery ()
void addRawValue (string $column, string $value)
void addValue (string $column, string $value)
void addWhere (string $condition, [integer $logicalOperation = _AND])
void reset ()
void setColumns (mixed $columns, array $table)
void setTable (string $table)
void setValues (array $values)
void setWhere (string $condition)
Variables
array $_columns (line 40)
  • var: A list of the columns we will be updating.
  • access: private
array $_condition (line 56)

This will store the condition in the WHERE clause. Each element of this array stores 2 things: the condition itself, and the logical operator to use to join with the previous condition.

  • var: The condition in the WHERE clause.
  • access: private
string $_table (line 34)
  • var: The name of the table to update.
  • access: private
array $_values (line 46)
  • var: List of values that will be assigned to the columns.
  • access: private

Inherited Variables

Inherited from QueryAbstract

QueryAbstract::$_type
Methods
Constructor UpdateQuery (line 63)

This is the constructor for a MySQL UPDATE query.

  • access: public
UpdateQuery UpdateQuery ()
addRawValue (line 122)

Add a column/value pair, if a value for the column exists, it will be overwritten. The value will not have any new escaping or quotes added to it.

  • since: 3/8/07
  • access: public
void addRawValue (string $column, string $value)
  • string $column
  • string $value
addValue (line 144)

Add a value, escaping it and surrounding it with quotes.

  • since: 3/8/07
  • access: public
void addValue (string $column, string $value)
  • string $column
  • string $value
addWhere (line 187)

Adds a new condition in the WHERE clause.

The query will execute only on rows that fulfil the condition. If this method is never called, then the WHERE clause will not be included.

  • access: public
void addWhere (string $condition, [integer $logicalOperation = _AND])
  • string $condition: condition The WHERE clause condition to add.
  • integer $logicalOperation: logicalOperation The logical operation to use to connect this WHERE condition with the previous WHERE conditions. Allowed values:
    1. _AND
    and
    1. _OR
    .
reset (line 208)

Resets the query.

  • access: public
void reset ()

Redefinition of:
QueryAbstract::reset()
Resets the query.
setColumns (line 87)

Sets the columns to update in the table.

  • access: public
void setColumns (mixed $columns, array $table)
  • array $table: The columns to insert into the table.
setTable (line 73)

Sets the table to update.

  • access: public
void setTable (string $table)
  • string $table: The table to insert into.
setValues (line 103)

Specifies the values that the will be assigned to the columns specified with setColumns().

  • access: public
void setValues (array $values)
  • array $values: The values that the will be assigned to the columns specified with setColumns().
setWhere (line 160)

*Deprecated* Specifies the condition in the WHERE clause.

The query will execute only on rows that fulfil the condition. If this method is never called, then the WHERE clause will not be included.

  • deprecated: July 09, 2003 - Use addWhere() instead.
  • access: public
void setWhere (string $condition)
  • string $condition: The WHERE clause condition.

Inherited Methods

Inherited From QueryAbstract

QueryAbstract::addWhereComparison()
QueryAbstract::addWhereEqual()
QueryAbstract::addWhereGreaterThan()
QueryAbstract::addWhereGreaterThanOrEqual()
QueryAbstract::addWhereIn()
QueryAbstract::addWhereLessThan()
QueryAbstract::addWhereLessThanOrEqual()
QueryAbstract::addWhereNotEqual()
QueryAbstract::addWhereNotIn()
QueryAbstract::addWhereNotNull()
QueryAbstract::addWhereNull()
QueryAbstract::addWhereRawComparison()
QueryAbstract::addWhereRawEqual()
QueryAbstract::addWhereRawGreaterThan()
QueryAbstract::addWhereRawGreaterThanOrEqual()
QueryAbstract::addWhereRawIn()
QueryAbstract::addWhereRawLessThan()
QueryAbstract::addWhereRawLessThanOrEqual()
QueryAbstract::addWhereRawNotEqual()
QueryAbstract::addWhereRawNotIn()
QueryAbstract::asString()
QueryAbstract::cleanColumn()
QueryAbstract::getType()
QueryAbstract::reset()

Inherited From SObject

SObject::asA()
SObject::asString()
SObject::copy()
SObject::copySameFrom()
SObject::copyTwoLevel()
SObject::deepCopy()
SObject::isEqual()
SObject::isEqualTo()
SObject::isNotEqualTo()
SObject::isNotReferenceTo()
SObject::isReferenceTo()
SObject::newFrom()
SObject::postCopy()
SObject::printableString()
SObject::shallowCopy()
SObject::_deepCopyArray()

Documentation generated on Wed, 19 Sep 2007 10:27:36 -0400 by phpDocumentor 1.3.0RC3