PHP Class Miner

Hardware/CPU Module for LoadAvg
Author: Karsten Becker
Inheritance: extends Logger
Show file Open project: jstayton/miner Class Usage Examples

Public Methods

Method Description
__construct ( PDO $PdoConnection = null, boolean $autoQuote = true ) : Miner Constructor.
__toString ( ) : string Get the full SQL statement without value placeholders.
andHaving ( string $column, mixed $value, string $operator = self::EQUALS, boolean | null $quote = null ) : Miner Add an AND HAVING condition.
andWhere ( string $column, mixed $value, string $operator = self::EQUALS, boolean | null $quote = null ) : Miner Add an AND WHERE condition.
autoQuote ( mixed $value, boolean | null $override = null ) : mixed | false Safely escape a value if auto-quoting is enabled, or do nothing if disabled.
calcFoundRows ( ) : Miner Add SQL_CALC_FOUND_ROWS execution option.
closeHaving ( ) : Miner Add a closing bracket for nesting HAVING conditions.
closeWhere ( ) : Miner Add a closing bracket for nesting WHERE conditions.
delete ( string | false $table = false ) : Miner Add a table to DELETE from, or false if deleting from the FROM table.
distinct ( ) : Miner Add DISTINCT execution option.
execute ( ) : PDOStatement | false Execute the statement using the PDO database connection.
from ( string $table, string $alias = null ) : Miner Set the FROM table with optional alias.
getAutoQuote ( boolean | null $override = null ) : boolean Get whether values will be automatically escaped.
getDeleteString ( boolean $includeText = true ) : string Get the DELETE portion of the statement as a string.
getFrom ( ) : string Get the FROM table.
getFromAlias ( ) : string Get the FROM table alias.
getFromString ( boolean $includeText = true ) : string Get the FROM portion of the statement, including all JOINs, as a string.
getGroupByString ( boolean $includeText = true ) : string Get the GROUP BY portion of the statement as a string.
getHavingPlaceholderValues ( ) : array Get the HAVING placeholder values.
getHavingString ( boolean $usePlaceholders = true, boolean $includeText = true ) : string Get the HAVING portion of the statement as a string.
getInsert ( ) : string Get the INSERT table.
getInsertString ( boolean $includeText = true ) : string Get the INSERT portion of the statement as a string.
getJoinString ( ) : string Get the JOIN portion of the statement as a string.
getLimit ( ) : integer | string Get the LIMIT on number of rows to return.
getLimitOffset ( ) : integer | string Get the LIMIT row number to start at.
getLimitString ( boolean $includeText = true ) : string Get the LIMIT portion of the statement as a string.
getOptionsString ( boolean $includeTrailingSpace = false ) : string Get the execution options portion of the statement as a string.
getOrderByString ( boolean $includeText = true ) : string Get the ORDER BY portion of the statement as a string.
getPdoConnection ( ) : PDO | null Get the PDO database connection to use in executing this statement.
getPlaceholderValues ( ) : array Get all placeholder values (SET, WHERE, and HAVING).
getReplace ( ) : string Get the REPLACE table.
getReplaceString ( boolean $includeText = true ) : string Get the REPLACE portion of the statement as a string.
getSelectString ( boolean $includeText = true ) : string Get the SELECT portion of the statement as a string.
getSetPlaceholderValues ( ) : array Get the SET placeholder values.
getSetString ( boolean $usePlaceholders = true, boolean $includeText = true ) : string Get the SET portion of the statement as a string.
getStatement ( boolean $usePlaceholders = true ) : string Get the full SQL statement.
getUpdate ( ) : string Get the UPDATE table.
getUpdateString ( boolean $includeText = true ) : string Get the UPDATE portion of the statement as a string.
getWherePlaceholderValues ( ) : array Get the WHERE placeholder values.
getWhereString ( boolean $usePlaceholders = true, boolean $includeText = true ) : string Get the WHERE portion of the statement as a string.
groupBy ( string $column, string | null $order = null ) : Miner Add a GROUP BY column.
having ( string $column, mixed $value, string $operator = self::EQUALS, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a HAVING condition.
havingBetween ( string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a BETWEEN HAVING condition.
havingIn ( string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add an IN WHERE condition.
havingNotBetween ( string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a NOT BETWEEN HAVING condition.
havingNotIn ( string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a NOT IN HAVING condition.
innerJoin ( string $table, string | array $criteria = null, string $alias = null ) : Miner Add an INNER JOIN table with optional ON criteria.
insert ( string $table ) : Miner Set the INSERT table.
isDelete ( ) : boolean Whether this is a DELETE statement.
isInsert ( ) : boolean Whether this is an INSERT statement.
isReplace ( ) : boolean Whether this is a REPLACE statement.
isSelect ( ) : boolean Whether this is a SELECT statement.
isUpdate ( ) : boolean Whether this is an UPDATE statement.
join ( string $table, string | array $criteria = null, string $type = self::INNER_JOIN, string $alias = null ) : Miner Add a JOIN table with optional ON criteria.
leftJoin ( string $table, string | array $criteria = null, string $alias = null ) : Miner Add a LEFT JOIN table with optional ON criteria.
limit ( integer | string $limit, integer | string $offset ) : Miner Set the LIMIT on number of rows to return with optional offset.
mergeDeleteInto ( Miner $Miner ) : Miner Merge this Miner's DELETE into the given Miner.
mergeFromInto ( Miner $Miner ) : Miner Merge this Miner's FROM into the given Miner.
mergeGroupByInto ( Miner $Miner ) : Miner Merge this Miner's GROUP BY into the given Miner.
mergeHavingInto ( Miner $Miner ) : Miner Merge this Miner's HAVING into the given Miner.
mergeInsertInto ( Miner $Miner ) : Miner Merge this Miner's INSERT into the given Miner.
mergeInto ( Miner $Miner, boolean $overrideLimit = true ) : Miner Merge this Miner into the given Miner.
mergeJoinInto ( Miner $Miner ) : Miner Merge this Miner's JOINs into the given Miner.
mergeLimitInto ( Miner $Miner ) : Miner Merge this Miner's LIMIT into the given Miner.
mergeOptionsInto ( Miner $Miner ) : Miner Merge this Miner's execution options into the given Miner.
mergeOrderByInto ( Miner $Miner ) : Miner Merge this Miner's ORDER BY into the given Miner.
mergeReplaceInto ( Miner $Miner ) : Miner Merge this Miner's REPLACE into the given Miner.
mergeSelectInto ( Miner $Miner ) : Miner Merge this Miner's SELECT into the given Miner.
mergeSetInto ( Miner $Miner ) : Miner Merge this Miner's SET into the given Miner.
mergeUpdateInto ( Miner $Miner ) : Miner Merge this Miner's UPDATE into the given Miner.
mergeWhereInto ( Miner $Miner ) : Miner Merge this Miner's WHERE into the given Miner.
openHaving ( string $connector = self::LOGICAL_AND ) : Miner Add an open bracket for nesting HAVING conditions.
openWhere ( string $connector = self::LOGICAL_AND ) : Miner Add an open bracket for nesting WHERE conditions.
option ( string $option ) : Miner Add an execution option like DISTINCT or SQL_CALC_FOUND_ROWS.
orHaving ( string $column, mixed $value, string $operator = self::EQUALS, boolean | null $quote = null ) : Miner Add an OR HAVING condition.
orWhere ( string $column, mixed $value, string $operator = self::EQUALS, boolean | null $quote = null ) : Miner Add an OR WHERE condition.
orderBy ( string $column, string $order = self::ORDER_BY_ASC ) : Miner Add a column to ORDER BY.
quote ( mixed $value ) : mixed | false Safely escape a value for use in a statement.
replace ( string $table ) : Miner Set the REPLACE table.
rightJoin ( string $table, string | array $criteria = null, string $alias = null ) : Miner Add a RIGHT JOIN table with optional ON criteria.
select ( string $column, string $alias = null ) : Miner Add a SELECT column, table, or expression with optional alias.
set ( string | array $column, mixed | null $value = null, boolean | null $quote = null ) : Miner Add one or more column values to INSERT, UPDATE, or REPLACE.
setAutoQuote ( boolean | null $autoQuote ) : Miner Set whether to automatically escape values.
setPdoConnection ( PDO $PdoConnection = null ) : Miner Set the PDO database connection to use in executing this statement.
update ( string $table ) : Miner Set the UPDATE table.
values ( array $values ) : Miner Add an array of columns => values to INSERT, UPDATE, or REPLACE.
where ( string $column, mixed $value, string $operator = self::EQUALS, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a WHERE condition.
whereBetween ( string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a BETWEEN WHERE condition.
whereIn ( string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add an IN WHERE condition.
whereNotBetween ( string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a NOT BETWEEN WHERE condition.
whereNotIn ( string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a NOT IN WHERE condition.

Private Methods

Method Description
closeCriteria ( array &$criteria ) : Miner Add a closing bracket for nesting conditions to the specified WHERE or HAVING criteria.
criteria ( array &$criteria, string $column, mixed $value, string $operator = self::EQUALS, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a condition to the specified WHERE or HAVING criteria.
criteriaBetween ( array &$criteria, string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a BETWEEN condition to the specified WHERE or HAVING criteria.
criteriaIn ( array &$criteria, string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add an IN condition to the specified WHERE or HAVING criteria.
criteriaNotBetween ( array &$criteria, string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a NOT BETWEEN condition to the specified WHERE or HAVING criteria.
criteriaNotIn ( array &$criteria, string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner Add a NOT IN condition to the specified WHERE or HAVING criteria.
getCriteriaString ( array &$criteria, boolean $usePlaceholders = true, array &$placeholderValues = [] ) : string Get the WHERE or HAVING portion of the statement as a string.
getDeleteStatement ( boolean $usePlaceholders = true ) : string Get the full DELETE statement.
getInsertStatement ( boolean $usePlaceholders = true ) : string Get the full INSERT statement.
getJoinCriteriaUsingPreviousTable ( integer $joinIndex, string $table, string $column ) : string Get an ON criteria string joining the specified table and column to the same column of the previous JOIN or FROM table.
getReplaceStatement ( boolean $usePlaceholders = true ) : string Get the full REPLACE statement.
getSelectStatement ( boolean $usePlaceholders = true ) : string Get the full SELECT statement.
getUpdateStatement ( boolean $usePlaceholders = true ) : string Get the full UPDATE statement.
isDeleteTableFrom ( ) : boolean Whether the FROM table is the single table to delete from.
isJoinUnique ( string $table, string $alias ) : boolean Whether the join table and alias is unique (hasn't already been joined).
openCriteria ( array &$criteria, string $connector = self::LOGICAL_AND ) : Miner Add an open bracket for nesting conditions to the specified WHERE or HAVING criteria.
orCriteria ( array &$criteria, string $column, mixed $value, string $operator = self::EQUALS, boolean | null $quote = null ) : Miner Add an OR condition to the specified WHERE or HAVING criteria.

Method Details

__construct() public method

Constructor.
public __construct ( PDO $PdoConnection = null, boolean $autoQuote = true ) : Miner
$PdoConnection PDO optional PDO database connection
$autoQuote boolean optional auto-escape values, default true
return Miner

__toString() public method

Get the full SQL statement without value placeholders.
public __toString ( ) : string
return string full SQL statement

andHaving() public method

Add an AND HAVING condition.
public andHaving ( string $column, mixed $value, string $operator = self::EQUALS, boolean | null $quote = null ) : Miner
$column string colum name
$value mixed value
$operator string optional comparison operator, default =
$quote boolean | null optional auto-escape value, default to global
return Miner

andWhere() public method

Add an AND WHERE condition.
public andWhere ( string $column, mixed $value, string $operator = self::EQUALS, boolean | null $quote = null ) : Miner
$column string colum name
$value mixed value
$operator string optional comparison operator, default =
$quote boolean | null optional auto-escape value, default to global
return Miner

autoQuote() public method

The $override parameter is for convenience in checking if a specific value should be quoted differently than the rest. 'null' defers to the global setting.
public autoQuote ( mixed $value, boolean | null $override = null ) : mixed | false
$value mixed value to escape (or not)
$override boolean | null value-specific override for convenience
return mixed | false value (escaped or original) or false if failed

calcFoundRows() public method

Add SQL_CALC_FOUND_ROWS execution option.
public calcFoundRows ( ) : Miner
return Miner

closeHaving() public method

Add a closing bracket for nesting HAVING conditions.
public closeHaving ( ) : Miner
return Miner

closeWhere() public method

Add a closing bracket for nesting WHERE conditions.
public closeWhere ( ) : Miner
return Miner

delete() public method

Add a table to DELETE from, or false if deleting from the FROM table.
public delete ( string | false $table = false ) : Miner
$table string | false optional table name, default false
return Miner

distinct() public method

Add DISTINCT execution option.
public distinct ( ) : Miner
return Miner

execute() public method

Execute the statement using the PDO database connection.
public execute ( ) : PDOStatement | false
return PDOStatement | false executed statement or false if failed

from() public method

Set the FROM table with optional alias.
public from ( string $table, string $alias = null ) : Miner
$table string table name
$alias string optional alias
return Miner

getAutoQuote() public method

The $override parameter is for convenience in checking if a specific value should be quoted differently than the rest. 'null' defers to the global setting.
public getAutoQuote ( boolean | null $override = null ) : boolean
$override boolean | null value-specific override for convenience
return boolean

getDeleteString() public method

Get the DELETE portion of the statement as a string.
public getDeleteString ( boolean $includeText = true ) : string
$includeText boolean optional include 'DELETE' text, default true
return string DELETE portion of the statement

getFrom() public method

Get the FROM table.
public getFrom ( ) : string
return string FROM table

getFromAlias() public method

Get the FROM table alias.
public getFromAlias ( ) : string
return string FROM table alias

getFromString() public method

Get the FROM portion of the statement, including all JOINs, as a string.
public getFromString ( boolean $includeText = true ) : string
$includeText boolean optional include 'FROM' text, default true
return string FROM portion of the statement

getGroupByString() public method

Get the GROUP BY portion of the statement as a string.
public getGroupByString ( boolean $includeText = true ) : string
$includeText boolean optional include 'GROUP BY' text, default true
return string GROUP BY portion of the statement

getHavingPlaceholderValues() public method

Get the HAVING placeholder values.
public getHavingPlaceholderValues ( ) : array
return array HAVING placeholder values

getHavingString() public method

Get the HAVING portion of the statement as a string.
public getHavingString ( boolean $usePlaceholders = true, boolean $includeText = true ) : string
$usePlaceholders boolean optional use ? placeholders, default true
$includeText boolean optional include 'HAVING' text, default true
return string HAVING portion of the statement

getInsert() public method

Get the INSERT table.
public getInsert ( ) : string
return string INSERT table

getInsertString() public method

Get the INSERT portion of the statement as a string.
public getInsertString ( boolean $includeText = true ) : string
$includeText boolean optional include 'INSERT' text, default true
return string INSERT portion of the statement

getJoinString() public method

Get the JOIN portion of the statement as a string.
public getJoinString ( ) : string
return string JOIN portion of the statement

getLimit() public method

Get the LIMIT on number of rows to return.
public getLimit ( ) : integer | string
return integer | string LIMIT on number of rows to return

getLimitOffset() public method

Get the LIMIT row number to start at.
public getLimitOffset ( ) : integer | string
return integer | string LIMIT row number to start at

getLimitString() public method

Get the LIMIT portion of the statement as a string.
public getLimitString ( boolean $includeText = true ) : string
$includeText boolean optional include 'LIMIT' text, default true
return string LIMIT portion of the statement

getOptionsString() public method

Get the execution options portion of the statement as a string.
public getOptionsString ( boolean $includeTrailingSpace = false ) : string
$includeTrailingSpace boolean optional include space after options
return string execution options portion of the statement

getOrderByString() public method

Get the ORDER BY portion of the statement as a string.
public getOrderByString ( boolean $includeText = true ) : string
$includeText boolean optional include 'ORDER BY' text, default true
return string ORDER BY portion of the statement

getPdoConnection() public method

Get the PDO database connection to use in executing this statement.
public getPdoConnection ( ) : PDO | null
return PDO | null

getPlaceholderValues() public method

Get all placeholder values (SET, WHERE, and HAVING).
public getPlaceholderValues ( ) : array
return array all placeholder values

getReplace() public method

Get the REPLACE table.
public getReplace ( ) : string
return string REPLACE table

getReplaceString() public method

Get the REPLACE portion of the statement as a string.
public getReplaceString ( boolean $includeText = true ) : string
$includeText boolean optional include 'REPLACE' text, default true
return string REPLACE portion of the statement

getSelectString() public method

Get the SELECT portion of the statement as a string.
public getSelectString ( boolean $includeText = true ) : string
$includeText boolean optional include 'SELECT' text, default true
return string SELECT portion of the statement

getSetPlaceholderValues() public method

Get the SET placeholder values.
public getSetPlaceholderValues ( ) : array
return array SET placeholder values

getSetString() public method

Get the SET portion of the statement as a string.
public getSetString ( boolean $usePlaceholders = true, boolean $includeText = true ) : string
$usePlaceholders boolean optional use ? placeholders, default true
$includeText boolean optional include 'SET' text, default true
return string SET portion of the statement

getStatement() public method

Get the full SQL statement.
public getStatement ( boolean $usePlaceholders = true ) : string
$usePlaceholders boolean optional use ? placeholders, default true
return string full SQL statement

getUpdate() public method

Get the UPDATE table.
public getUpdate ( ) : string
return string UPDATE table

getUpdateString() public method

Get the UPDATE portion of the statement as a string.
public getUpdateString ( boolean $includeText = true ) : string
$includeText boolean optional include 'UPDATE' text, default true
return string UPDATE portion of the statement

getWherePlaceholderValues() public method

Get the WHERE placeholder values.
public getWherePlaceholderValues ( ) : array
return array WHERE placeholder values

getWhereString() public method

Get the WHERE portion of the statement as a string.
public getWhereString ( boolean $usePlaceholders = true, boolean $includeText = true ) : string
$usePlaceholders boolean optional use ? placeholders, default true
$includeText boolean optional include 'WHERE' text, default true
return string WHERE portion of the statement

groupBy() public method

Add a GROUP BY column.
public groupBy ( string $column, string | null $order = null ) : Miner
$column string column name
$order string | null optional order direction, default none
return Miner

having() public method

Add a HAVING condition.
public having ( string $column, mixed $value, string $operator = self::EQUALS, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string colum name
$value mixed value
$operator string optional comparison operator, default =
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner

havingBetween() public method

Add a BETWEEN HAVING condition.
public havingBetween ( string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string column name
$min mixed minimum value
$max mixed maximum value
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner

havingIn() public method

Add an IN WHERE condition.
public havingIn ( string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string column name
$values array values
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner

havingNotBetween() public method

Add a NOT BETWEEN HAVING condition.
public havingNotBetween ( string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string column name
$min mixed minimum value
$max mixed maximum value
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner

havingNotIn() public method

Add a NOT IN HAVING condition.
public havingNotIn ( string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string column name
$values array values
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner

innerJoin() public method

Add an INNER JOIN table with optional ON criteria.
public innerJoin ( string $table, string | array $criteria = null, string $alias = null ) : Miner
$table string table name
$criteria string | array optional ON criteria
$alias string optional alias
return Miner

insert() public method

Set the INSERT table.
public insert ( string $table ) : Miner
$table string INSERT table
return Miner

isDelete() public method

Whether this is a DELETE statement.
public isDelete ( ) : boolean
return boolean whether this is a DELETE statement

isInsert() public method

Whether this is an INSERT statement.
public isInsert ( ) : boolean
return boolean whether this is an INSERT statement

isReplace() public method

Whether this is a REPLACE statement.
public isReplace ( ) : boolean
return boolean whether this is a REPLACE statement

isSelect() public method

Whether this is a SELECT statement.
public isSelect ( ) : boolean
return boolean whether this is a SELECT statement

isUpdate() public method

Whether this is an UPDATE statement.
public isUpdate ( ) : boolean
return boolean whether this is an UPDATE statement

join() public method

Add a JOIN table with optional ON criteria.
public join ( string $table, string | array $criteria = null, string $type = self::INNER_JOIN, string $alias = null ) : Miner
$table string table name
$criteria string | array optional ON criteria
$type string optional type of join, default INNER JOIN
$alias string optional alias
return Miner

leftJoin() public method

Add a LEFT JOIN table with optional ON criteria.
public leftJoin ( string $table, string | array $criteria = null, string $alias = null ) : Miner
$table string table name
$criteria string | array optional ON criteria
$alias string optional alias
return Miner

limit() public method

Set the LIMIT on number of rows to return with optional offset.
public limit ( integer | string $limit, integer | string $offset ) : Miner
$limit integer | string number of rows to return
$offset integer | string optional row number to start at, default 0
return Miner

mergeDeleteInto() public method

Merge this Miner's DELETE into the given Miner.
public mergeDeleteInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeFromInto() public method

Merge this Miner's FROM into the given Miner.
public mergeFromInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeGroupByInto() public method

Merge this Miner's GROUP BY into the given Miner.
public mergeGroupByInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeHavingInto() public method

Merge this Miner's HAVING into the given Miner.
public mergeHavingInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeInsertInto() public method

Merge this Miner's INSERT into the given Miner.
public mergeInsertInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeInto() public method

Merge this Miner into the given Miner.
public mergeInto ( Miner $Miner, boolean $overrideLimit = true ) : Miner
$Miner Miner to merge into
$overrideLimit boolean optional override limit, default true
return Miner

mergeJoinInto() public method

Merge this Miner's JOINs into the given Miner.
public mergeJoinInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeLimitInto() public method

Merge this Miner's LIMIT into the given Miner.
public mergeLimitInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeOptionsInto() public method

Merge this Miner's execution options into the given Miner.
public mergeOptionsInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeOrderByInto() public method

Merge this Miner's ORDER BY into the given Miner.
public mergeOrderByInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeReplaceInto() public method

Merge this Miner's REPLACE into the given Miner.
public mergeReplaceInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeSelectInto() public method

Merge this Miner's SELECT into the given Miner.
public mergeSelectInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeSetInto() public method

Merge this Miner's SET into the given Miner.
public mergeSetInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeUpdateInto() public method

Merge this Miner's UPDATE into the given Miner.
public mergeUpdateInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

mergeWhereInto() public method

Merge this Miner's WHERE into the given Miner.
public mergeWhereInto ( Miner $Miner ) : Miner
$Miner Miner to merge into
return Miner

openHaving() public method

Add an open bracket for nesting HAVING conditions.
public openHaving ( string $connector = self::LOGICAL_AND ) : Miner
$connector string optional logical connector, default AND
return Miner

openWhere() public method

Add an open bracket for nesting WHERE conditions.
public openWhere ( string $connector = self::LOGICAL_AND ) : Miner
$connector string optional logical connector, default AND
return Miner

option() public method

Add an execution option like DISTINCT or SQL_CALC_FOUND_ROWS.
public option ( string $option ) : Miner
$option string execution option to add
return Miner

orHaving() public method

Add an OR HAVING condition.
public orHaving ( string $column, mixed $value, string $operator = self::EQUALS, boolean | null $quote = null ) : Miner
$column string colum name
$value mixed value
$operator string optional comparison operator, default =
$quote boolean | null optional auto-escape value, default to global
return Miner

orWhere() public method

Add an OR WHERE condition.
public orWhere ( string $column, mixed $value, string $operator = self::EQUALS, boolean | null $quote = null ) : Miner
$column string colum name
$value mixed value
$operator string optional comparison operator, default =
$quote boolean | null optional auto-escape value, default to global
return Miner

orderBy() public method

Add a column to ORDER BY.
public orderBy ( string $column, string $order = self::ORDER_BY_ASC ) : Miner
$column string column name
$order string optional order direction, default ASC
return Miner

quote() public method

Safely escape a value for use in a statement.
public quote ( mixed $value ) : mixed | false
$value mixed value to escape
return mixed | false escaped value or false if failed

replace() public method

Set the REPLACE table.
public replace ( string $table ) : Miner
$table string REPLACE table
return Miner

rightJoin() public method

Add a RIGHT JOIN table with optional ON criteria.
public rightJoin ( string $table, string | array $criteria = null, string $alias = null ) : Miner
$table string table name
$criteria string | array optional ON criteria
$alias string optional alias
return Miner

select() public method

Add a SELECT column, table, or expression with optional alias.
public select ( string $column, string $alias = null ) : Miner
$column string column name, table name, or expression
$alias string optional alias
return Miner

set() public method

Add one or more column values to INSERT, UPDATE, or REPLACE.
public set ( string | array $column, mixed | null $value = null, boolean | null $quote = null ) : Miner
$column string | array column name or array of columns => values
$value mixed | null optional value for single column
$quote boolean | null optional auto-escape value, default to global
return Miner

setAutoQuote() public method

Set whether to automatically escape values.
public setAutoQuote ( boolean | null $autoQuote ) : Miner
$autoQuote boolean | null whether to automatically escape values
return Miner

setPdoConnection() public method

Set the PDO database connection to use in executing this statement.
public setPdoConnection ( PDO $PdoConnection = null ) : Miner
$PdoConnection PDO optional PDO database connection
return Miner

update() public method

Set the UPDATE table.
public update ( string $table ) : Miner
$table string UPDATE table
return Miner

values() public method

Add an array of columns => values to INSERT, UPDATE, or REPLACE.
public values ( array $values ) : Miner
$values array columns => values
return Miner

where() public method

Add a WHERE condition.
public where ( string $column, mixed $value, string $operator = self::EQUALS, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string column name
$value mixed value
$operator string optional comparison operator, default =
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner

whereBetween() public method

Add a BETWEEN WHERE condition.
public whereBetween ( string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string column name
$min mixed minimum value
$max mixed maximum value
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner

whereIn() public method

Add an IN WHERE condition.
public whereIn ( string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string column name
$values array values
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner

whereNotBetween() public method

Add a NOT BETWEEN WHERE condition.
public whereNotBetween ( string $column, mixed $min, mixed $max, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string column name
$min mixed minimum value
$max mixed maximum value
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner

whereNotIn() public method

Add a NOT IN WHERE condition.
public whereNotIn ( string $column, array $values, string $connector = self::LOGICAL_AND, boolean | null $quote = null ) : Miner
$column string column name
$values array values
$connector string optional logical connector, default AND
$quote boolean | null optional auto-escape value, default to global
return Miner