PHP Class ParagonIE\EasyDB\EasyStatement

Afficher le fichier Open project: paragonie/easydb Class Usage Examples

Méthodes publiques

Méthode Description
__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().

Méthodes protégées

Méthode Description
__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.

Private Methods

Méthode Description
unpackCondition ( string $condition, integer $count ) : string Replace a grouped placeholder with a list of placeholders.

Method Details

__construct() protected méthode

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

__toString() public méthode

Convert the statement to a string.
public __toString ( ) : string
Résultat string

andGroup() public méthode

Exit the group with endGroup().
public andGroup ( ) : self
Résultat self

andIn() public méthode

Instead of using ? to denote the placeholder, ?* must be used!
public andIn ( string $condition, array $values ) : self
$condition string
$values array
Résultat self

andWith() public méthode

Add a condition that will be applied with a logical "AND".
public andWith ( string $condition, $values ) : self
$condition string
$values
Résultat self

end() public méthode

Alias for endGroup().
public end ( ) : self
Résultat self

endGroup() public méthode

Exit the current grouping and return the parent statement.
public endGroup ( ) : self
Résultat self

group() public méthode

Alias for andGroup().
public group ( ) : self
Résultat self

in() public méthode

Alias for andIn().
public in ( string $condition, array $values ) : self
$condition string
$values array
Résultat self

isGroup() protected méthode

Check if a condition is a sub-group.
protected isGroup ( mixed $condition ) : boolean
$condition mixed
Résultat boolean

open() public static méthode

Open a new statement.
public static open ( ) : self
Résultat self

orGroup() public méthode

Exit the group with endGroup().
public orGroup ( ) : self
Résultat self

orIn() public méthode

Instead of using "?" to denote the placeholder, "?*" must be used!
public orIn ( string $condition, array $values ) : self
$condition string
$values array
Résultat self

orWith() public méthode

Add a condition that will be applied with a logical "OR".
public orWith ( string $condition, $values ) : self
$condition string
$values
Résultat self

sql() public méthode

Compile the current statement into PDO-ready SQL.
public sql ( ) : string
Résultat string

values() public méthode

Get all of the parameters attached to this statement.
public values ( ) : array
Résultat array

with() public méthode

Alias for andWith().
public with ( string $condition, $values ) : self
$condition string
Résultat self