PHP Class phprs\ezsql\rules\basic\WhereRule

Inheritance: extends OrderByRule
Show file Open project: caoym/phprs-restful Class Usage Examples

Public Methods

Method Description
where ( string $expr, mixed $_ = null ) : OrderByRule where('a=?', 1) => "WHERE a=1" where('a=?', Sql::native('now()')) => "WHERE a=now()" where('a IN (?)', [1, 2]) => "WHERE a IN (1,2)"
whereArgs ( string $args ) : OrderByRule whereArgs([ 'a'=>1, 'b'=>['IN'=>[1,2]] 'c'=>['BETWEEN'=>[1,2]] 'd'=>['<>'=>1] ])

Method Details

where() public method

where('a=?', 1) => "WHERE a=1" where('a=?', Sql::native('now()')) => "WHERE a=now()" where('a IN (?)', [1, 2]) => "WHERE a IN (1,2)"
public where ( string $expr, mixed $_ = null ) : OrderByRule
$expr string
$_ mixed
return OrderByRule

whereArgs() public method

=> "WHERE a=1 AND b IN(1,2) AND c BETWEEN 1 AND 2 AND d<>1"
public whereArgs ( string $args ) : OrderByRule
$args string
return OrderByRule