PHP Класс ParagonIE\EasyDB\EasyStatement

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__toString ( ) : string Convert the statement to a string.
andGroup ( ) : self Start a new grouping that will be applied with a logical "AND".
andIn ( string $condition, array $values ) : self Add an IN condition that will be applied with a logical "AND".
andWith ( string $condition, $values ) : self Add a condition that will be applied with a logical "AND".
end ( ) : self Alias for endGroup().
endGroup ( ) : self Exit the current grouping and return the parent statement.
group ( ) : self Alias for andGroup().
in ( string $condition, array $values ) : self Alias for andIn().
open ( ) : self Open a new statement.
orGroup ( ) : self Start a new grouping that will be applied with a logical "OR".
orIn ( string $condition, array $values ) : self Add an IN condition that will be applied with a logical "OR".
orWith ( string $condition, $values ) : self Add a condition that will be applied with a logical "OR".
sql ( ) : string Compile the current statement into PDO-ready SQL.
values ( ) : array Get all of the parameters attached to this statement.
with ( string $condition, $values ) : self Alias for andWith().

Защищенные методы

Метод Описание
__construct ( EasyStatement $parent = null ) Don't instantiate directly. Instead, use open() (static method).
isGroup ( mixed $condition ) : boolean Check if a condition is a sub-group.

Приватные методы

Метод Описание
unpackCondition ( string $condition, integer $count ) : string Replace a grouped placeholder with a list of placeholders.

Описание методов

__construct() защищенный Метод

EasyStatement constructor.
protected __construct ( EasyStatement $parent = null )
$parent EasyStatement

__toString() публичный Метод

Convert the statement to a string.
public __toString ( ) : string
Результат string

andGroup() публичный Метод

Exit the group with endGroup().
public andGroup ( ) : self
Результат self

andIn() публичный Метод

Instead of using ? to denote the placeholder, ?* must be used!
public andIn ( string $condition, array $values ) : self
$condition string
$values array
Результат self

andWith() публичный Метод

Add a condition that will be applied with a logical "AND".
public andWith ( string $condition, $values ) : self
$condition string
$values
Результат self

end() публичный Метод

Alias for endGroup().
public end ( ) : self
Результат self

endGroup() публичный Метод

Exit the current grouping and return the parent statement.
public endGroup ( ) : self
Результат self

group() публичный Метод

Alias for andGroup().
public group ( ) : self
Результат self

in() публичный Метод

Alias for andIn().
public in ( string $condition, array $values ) : self
$condition string
$values array
Результат self

isGroup() защищенный Метод

Check if a condition is a sub-group.
protected isGroup ( mixed $condition ) : boolean
$condition mixed
Результат boolean

open() публичный статический Метод

Open a new statement.
public static open ( ) : self
Результат self

orGroup() публичный Метод

Exit the group with endGroup().
public orGroup ( ) : self
Результат self

orIn() публичный Метод

Instead of using "?" to denote the placeholder, "?*" must be used!
public orIn ( string $condition, array $values ) : self
$condition string
$values array
Результат self

orWith() публичный Метод

Add a condition that will be applied with a logical "OR".
public orWith ( string $condition, $values ) : self
$condition string
$values
Результат self

sql() публичный Метод

Compile the current statement into PDO-ready SQL.
public sql ( ) : string
Результат string

values() публичный Метод

Get all of the parameters attached to this statement.
public values ( ) : array
Результат array

with() публичный Метод

Alias for andWith().
public with ( string $condition, $values ) : self
$condition string
Результат self