Pheasant\Query\Criteria::concatAnd PHP Method

concatAnd() public static method

Joins all parameters together with AND
public static concatAnd ( ) : Criteria
return Criteria
    public static function concatAnd()
    {
        return new Criteria(implode(' AND ', func_get_args()));
    }

Usage Example

Example #1
0
 public function testCriteriaConcat()
 {
     $c = new Criteria();
     $c = $c->or(Criteria::concatAnd('a > 1', $c->bind('b != ?', 'blargh')), 'x = 1');
     $this->assertEquals("((a > 1 AND b != 'blargh') OR x = 1)", $c->toSql());
 }