\Fuman_Db_Where

The where structure of an sql statement

Summary

Methods
Properties
Constants
__construct()
setOperator()
getOperator()
addColumn()
addExpression()
getStatements()
add()
removeAt()
hasStatements()
remove()
resetStatements()
getStatement()
create()
__clone()
addFrom()
No public properties found
No constants found
No protected methods found
$_operator
$_statements
N/A
No private methods found
No private properties found
N/A

Properties

$_operator

$_operator : string

Operator

Type

string

$_statements

$_statements : array

Statement

Type

array

Methods

__construct()

__construct(string  $operator = 'AND') : \Fuman_Db_Where

Constructor

Parameters

string $operator

AND|OR

Returns

\Fuman_Db_Where

setOperator()

setOperator(string  $operator) : void

Setter for operator

Parameters

string $operator

getOperator()

getOperator() : string

Gets operator (AND, OR)

Returns

string

addColumn()

addColumn(string  $columnName, mixed  $value, string  $operator, boolean  $valueIsDbFunction = false) : void

Add column

Parameters

string $columnName
mixed $value
string $operator
boolean $valueIsDbFunction

addExpression()

addExpression(string  $expression, \Fuman_Db_Parameters  $parameters = null) 

Add expression (like [id]=1)

Parameters

string $expression
\Fuman_Db_Parameters $parameters

getStatements()

getStatements() : array<mixed,\stdClass>

Get statements

Returns

array<mixed,\stdClass>

add()

add(\Fuman_Db_Where|null  $where = null) : void

Adds where statement

Parameters

\Fuman_Db_Where|null $where

removeAt()

removeAt(integer  $index) : void

Removes a statement by index.

Parameters

integer $index

hasStatements()

hasStatements() : boolean

Returns boolean

Returns

boolean

remove()

remove(\Fuman_Db_Where  $where) : boolean

Removes a object from the statements container

Parameters

\Fuman_Db_Where $where

Returns

boolean

resetStatements()

resetStatements() 

resets the statement container

getStatement()

getStatement(\Fuman_Table  $table, \Fuman_Db_Parameters  $parameters, string|null  $alias = null) : string

Returns a where String.

Note: String does not contain 'WHERE'

Parameters

\Fuman_Table $table
\Fuman_Db_Parameters $parameters
string|null $alias

Returns

string

create()

create(string  $operator, string  $columnName, string|integer|null  $value, string  $columnOperator = '') : \Fuman_Db_Where

Builds a new Fuman_Db_Where Instance

Parameters

string $operator
string $columnName
string|integer|null $value
string $columnOperator

Throws

\Fuman_Exception

Returns

\Fuman_Db_Where

__clone()

__clone() 

addFrom()

addFrom(\Fuman_Db_Where  $where) 

Parameters

\Fuman_Db_Where $where