Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Query Class Reference

Public Member Functions

 __construct ($queryid='', array $arrayRepresentation=array(), $sqlString='')
 
 getQueryType ()
 
 getArrayRepresentation ()
 
 merge ($bindName, Query $query)
 
 replaceBindVarName ($oldName, $newName)
 
 getQueryid ()
 
 getBindings ()
 
 getQueryArray ()
 
 getSql ($convert=FALSE)
 
 prepare ()
 
 setExecMethod ($method)
 
 getExecMethod ()
 
 bind ($name, $value, $dataType=NULL)
 
 subQueries ($subQueryid, array $queries)
 
 keywords (array $keywords)
 
 releaseLobs ()
 

Data Fields

 $_lobStack = Array()
 

Detailed Description

Query.

Object that represents a query in the MySource 4 system.

Since
4.0.0

Definition at line 22 of file Query.inc.

Constructor & Destructor Documentation

__construct (   $queryid = '',
array  $arrayRepresentation = array(),
  $sqlString = '' 
)

Creates a new query object with the data provided.

Parameters
string$queryidThe ID of the query to bake out.
array$arrayRepresentationThe structured array representation of the query.
string$sqlStringThe SQL of the query.
Since
4.0.0
Exceptions
DALExceptionIf query represantation is invalid.

Definition at line 124 of file Query.inc.

Member Function Documentation

bind (   $name,
  $value,
  $dataType = NULL 
)

Add binding to the query.

If value is an array then use arraySplit. If value is another Query then use merge.

Parameters
string$nameThe name of the bind variable.
mixed$valueThe value to set the variable to.
integer$dataTypeThe type to bind the value with.
Since
4.0.0
Returns
void

Definition at line 458 of file Query.inc.

getArrayRepresentation ( )

Returns the array representation.

Since
4.0.0
Returns
string

Definition at line 157 of file Query.inc.

getBindings ( )

Returns list of bind variables.

Since
4.0.0
Returns
array

Definition at line 316 of file Query.inc.

getExecMethod ( )

Returns the execution method.

For example: executeAssoc

Since
4.0.0
Returns
string

Definition at line 438 of file Query.inc.

getQueryArray ( )

Returns the array representaion of this Query.

Since
4.0.0
Returns
array

Definition at line 329 of file Query.inc.

getQueryid ( )

Returns this query's id.

Since
4.0.0
Returns
string

Definition at line 303 of file Query.inc.

getQueryType ( )

Returns the type of execution this method has specified.

Since
4.0.0
Returns
string

Definition at line 144 of file Query.inc.

getSql (   $convert = FALSE)

Returns the SQL string representaion of this Query.

Parameters
boolean$convertIf TRUE will perform conversion of the query into SQL before returning, otherwise the SQL is returned in its' current form.
Since
4.0.0
Returns
array

Definition at line 346 of file Query.inc.

keywords ( array  $keywords)

Add keywords to the query.

array('keyword' => value)

Parameters
array$keywordsArray of keywords to add.
Since
4.0.0
Returns
void

Definition at line 583 of file Query.inc.

merge (   $bindName,
Query  $query 
)

Merge a query into this one.

Parameters
string$bindNameThe bind variable the query will replace.
Query$queryThe query to merge as part of this one.
Since
4.0.0
Returns
boolean

Definition at line 173 of file Query.inc.

prepare ( )

Prepare the query for execution and returns the PDOStatement.

Since
4.0.0
Returns
PDOStatement

Definition at line 366 of file Query.inc.

releaseLobs ( )

Releases any OCI8 CLOB objects that may have been created here

Since
4.0.0
Returns
array

Definition at line 596 of file Query.inc.

replaceBindVarName (   $oldName,
  $newName 
)

Replaces the given bind varibale name with a new name in SQL string.

Parameters
string$oldNameOld name of the bind variable.
string$newNameNew name of the bind variable.
Since
4.0.0
Returns
void

Definition at line 290 of file Query.inc.

setExecMethod (   $method)

Set the execution method.

For example: executeAssoc.

Parameters
string$methodThe method to set for the query.
Since
4.0.0
Returns
void

Definition at line 423 of file Query.inc.

subQueries (   $subQueryid,
array  $queries 
)

Adds sub queries (hooks) to the current query.

Parameters
string$subQueryidThe sub hookid to merge.
array$queriesThe queries to add.
Since
4.0.0
Returns
void

Definition at line 559 of file Query.inc.


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