Rebar Project - MySQL Engine
Public Member Functions | List of all members
InsertQuery Class Reference
Inheritance diagram for InsertQuery:
WriteQuery Query

Public Member Functions

 __construct ($tablename, $insertfields, $ignore=false)
 
 setInsertFields ($insertfields)
 
 makeQuery (&$query_string, &$dtype_string)
 
- Public Member Functions inherited from WriteQuery
 setTablename ($tablename)
 
- Public Member Functions inherited from Query
 setParameters ($parameters)
 
 enableLimits ($limits)
 
 makeQuery (&$query_string, &$dtype_string)
 

Additional Inherited Members

- Static Public Attributes inherited from Query
static $OPER_EQ = ' = '
 
static $OPER_NE = ' <> '
 
static $OPER_GT = ' > '
 
static $OPER_GE = ' >= '
 
static $OPER_LT = ' < '
 
static $OPER_LE = ' <= '
 
static $BOOL_AND = ' and '
 
static $BOOL_OR = ' or '
 
static $DTYPE_D = 'd'
 
static $DTYPE_I = 'i'
 
static $DTYPE_S = 's'
 
static $ORDER_A = ' asc'
 
static $ORDER_D = ' desc'
 
static $LOCK_R = ' read'
 
static $LOCK_W = ' write'
 
- Protected Member Functions inherited from WriteQuery
 setWriteFields ($fields)
 
- Protected Member Functions inherited from Query
 makeParameterString ($parameters, &$query_string, &$dtype_string, $where=true)
 
 makeLimitString (&$query_string, &$dtype_string)
 

Detailed Description

SVN

Id
InsertQuery.php 14 2017-02-02 21:06:24Z phil
Author
Phil Riesch phil@.nosp@m.phil.nosp@m.riesc.nosp@m.h.co.nosp@m.m

LICENSE

The PHP Rebar Project Copyright 2017 Philip Riesch phil@.nosp@m.phil.nosp@m.riesc.nosp@m.h.co.nosp@m.m

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

– Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

– Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

– Neither the name of Philip J. Riesch nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PHILIP J. RIESCH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

DESCRIPTION

The InsertQuery class allows for the construction of SQL Insert queries that can then be executed on a target database.

Constructor & Destructor Documentation

InsertQuery::__construct (   $tablename,
  $insertfields,
  $ignore = false 
)

Constructor. See affiliated setter functions for expanded descriptions as to the kinds of input that these arguments will expect.

Parameters
$tablenamestring The name of the table to insert into
$insertfieldsarray The specification for the fields to insert data into
$ignoreboolean Ignore unique key collisions. If set to false then a unique key collision will result in an exception

Member Function Documentation

InsertQuery::makeQuery ( $query_string,
$dtype_string 
)

Used by the MysqlFacet class when it is executing the query.

Parameters
&$query_stringstring The generated SQL query
&$dtype_Stringstring The generated input data type string
InsertQuery::setInsertFields (   $insertfields)

Sets the fields in the table that are to be inserted into.

This function expects an array of arrays: each array contaning two values. The first value is the name of the field. The second value is the appropriate dtype that the query expects as input for this field: Query::$DTYPE_D, Query::$DTYPE_I, or Query::$DTYPE_S.

Parameters
$updatefieldsarray The fields to be inserted.

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