Class InsertQuery

Description

Implements interfaces:

An InsertQuery object provides the tools to build an INSERT query.

This is an abstract class that simply provides all the accessor methods, initialization steps, etc. What is left to be implemented is the generateSQLQuery() method.

Located in /harmoni/core/DBHandler/InsertQuery.class.php (line 28)

SObject
   |
   --QueryAbstract
      |
      --InsertQuery
Variable Summary
array $_columns
string $_sequence
string $_table
array $_values
Method Summary
InsertQuery InsertQuery ()
integer addColumn (string $column)
void addRawValue (string $column, string $value)
void addRowOfValues (array $values)
void addValue (string $column, string $value)
void createRow ()
void reset ()
void setAutoIncrementColumn (string $column, string $sequence)
void setColumns (mixed $columns, array $table)
void setTable (string $table)
void setValues (array $values)
Variables
string $_autoIncrementColumn (line 59)

The autoincrement column.

  • var: _autoIncrementColumn
  • access: private
array $_columns (line 43)
  • var: The list of columns we will be inserting.
  • access: private
string $_sequence (line 67)

The sequence to use for generating new ids for the autoincrement column.

  • var: _sequence
  • access: private
string $_table (line 37)
  • var: The name of the table to insert into.
  • access: private
array $_values (line 51)
  • var: This variable is an array of arrays. The outer array stores all the rows that will be inserted. The inner array stores the field values of the current row.
  • access: private

Inherited Variables

Inherited from QueryAbstract

QueryAbstract::$_type
Methods
Constructor InsertQuery (line 74)

This is the constructor for a MySQL INSERT query.

  • access: public
InsertQuery InsertQuery ()
addColumn (line 136)

Add a new column and populate all rows of values with a null value. Return the array index of the new column.

  • since: 3/8/07
  • access: public
integer addColumn (string $column)
  • string $column
addRawValue (line 160)

Add a column/value pair to the latest row, if a value for the column exists, it will be overwritten. The value will not have any new escaping or quotes added to it. All rows of values MUST have the same number and order of columns.

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

Adds one row of values to insert into the table.

By calling this method multiple times, you can insert many rows of information using just one query.

  • access: public
void addRowOfValues (array $values)
  • array $values: One row of values to insert into the table. Must match the order of columns specified with the setColumns() method.
addValue (line 186)

Add a value to the latest row, escaping it and surrounding it with quotes.

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

Create a new, empty row. This is used when adding values via the addValue() or addRawValue() method rather than the setColumns.

  • since: 3/8/07
  • access: public
void createRow ()
reset (line 251)

Resets the query.

  • access: public
void reset ()

Redefinition of:
QueryAbstract::reset()
Resets the query.
setAutoIncrementColumn (line 232)

Sets the autoincrement column.

Sets the autoincrement column. This could be useful with Oracle, for example.

  • access: public
void setAutoIncrementColumn (string $column, string $sequence)
  • string $column: The autoincrement column.
  • string $sequence: The sequence to use for generating new ids.
setColumns (line 100)

Sets the columns to insert into the table.

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

Sets the table to insert into.

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

This is an alias for addRowOfValues for compatability with the UpdateQuery class.

Adds one row of values to insert into the table. By calling this method multiple times, you can insert many rows of information using just one query.

  • access: public
  • see: InsertQueryInterface::addRowOfValues
void setValues (array $values)
  • array $values: One row of values to insert into the table. Must match the order of columns specified with the setColumns() method.

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:24:39 -0400 by phpDocumentor 1.3.0RC3