.

DBQueryInsert Class Reference
[Model]

An Insert Query. More...

Inheritance diagram for DBQueryInsert:
DBQuery IDBQuery IDBSqlBuilder IPolicyHolder IDBWhereHolder DBQueryReplace

List of all members.

Public Member Functions

  get_select ()
  Return select query.
  get_sql ()
  Return SQL fragment.
  set_select (DBQuerySelect $query)
  Set optional select query.

Public Attributes

const  DELAYED = 1
  Delayed Insert Policy.
const  IGNORE = 2
  Ignore Errors Policy.

Protected Attributes

  $select_query = null

Detailed Description

An Insert Query.

Author:
Gerd Riesselmann

Definition at line 8 of file dbquery.insert.cls.php.


Member Function Documentation

DBQueryInsert::get_select (  ) 

Return select query.

Returns:
DBQuerySelect

Definition at line 38 of file dbquery.insert.cls.php.

00038                                      {
00039                 return $this->select_query;
00040         }
DBQueryInsert::get_sql (  ) 

Return SQL fragment.

Returns:
string

Implements IDBSqlBuilder.

Reimplemented in DBQueryReplace.

Definition at line 47 of file dbquery.insert.cls.php.

00047                                   {
00048                 $params = array();
00049                 if ($this->policy & self::DELAYED) {
00050                         $params['delayed'] = true;
00051                 }
00052                 if ($this->policy & self::IGNORE) {
00053                         $params['ignore'] = true;
00054                 }
00055                 if (!empty($this->select_query)) {
00056                         $params['select'] = $this->select_query;
00057                 }
00058                 $params['fields'] = $this->fields; 
00059                 $builder = DBSqlBuilderFactory::create_builder(DBSqlBuilderFactory::INSERT, $this, $params);
00060                 return $builder->get_sql();             
00061         }       
DBQueryInsert::set_select ( DBQuerySelect query  ) 

Set optional select query.

Parameters:
DBQuerySelect  $query

Definition at line 29 of file dbquery.insert.cls.php.

00029                                                          {
00030                 $this->select_query = $query; 
00031         }

Member Data Documentation

DBQueryInsert::$select_query = null [protected]

Definition at line 22 of file dbquery.insert.cls.php.

Delayed Insert Policy.

Definition at line 12 of file dbquery.insert.cls.php.

Ignore Errors Policy.

Definition at line 16 of file dbquery.insert.cls.php.


The documentation for this class was generated from the following file: