PHP Class Pheasant\Query\Criteria

Show file Open project: lox/pheasant Class Usage Examples

Public Methods

Method Description
__call ( $method, $params ) Triggers either the and() or or() methods
__construct ( $where = null, $params = [] ) Constructor
__toString ( )
bind ( $sql, $params = [] ) : string Binds an array of parameters into a string
concatAnd ( ) : Criteria Joins all parameters together with AND
concatOr ( ) : Criteria Joins all parameters together with OR
isEmpty ( ) Returns whether the criteria is empty
toSql ( $braces = true ) Returns the sql representation of the where clause

Method Details

__call() public method

Triggers either the and() or or() methods
public __call ( $method, $params )

__construct() public method

Constructor
public __construct ( $where = null, $params = [] )
$where either a query string, or a key=>val array
$params mixed, parameters to bind into the query string

__toString() public method

public __toString ( )

bind() public method

Binds an array of parameters into a string
public bind ( $sql, $params = [] ) : string
return string

concatAnd() public static method

Joins all parameters together with AND
public static concatAnd ( ) : Criteria
return Criteria

concatOr() public static method

Joins all parameters together with OR
public static concatOr ( ) : Criteria
return Criteria

isEmpty() public method

Returns whether the criteria is empty
public isEmpty ( )

toSql() public method

Returns the sql representation of the where clause
public toSql ( $braces = true )