JamesMoss\Flywheel\Predicate::where PHP Method

where() public method

public where ( $field, $operator = null, $value = null )
    public function where($field, $operator = null, $value = null)
    {
        return $this->andWhere($field, $operator, $value);
    }

Usage Example

Example #1
0
 public function testAddingSubPredicate()
 {
     $pred = new Predicate();
     $pred->where('name', '==', 'hannah')->andWhere(function ($query) {
         $query->where('age', '<', 20)->orWhere('age', '>', 30);
     });
     $this->assertEquals(array(array(false, 'name', '==', 'hannah'), array('and', array(array(false, 'age', '<', 20), array('or', 'age', '>', 30)))), $pred->getAll());
 }
All Usage Examples Of JamesMoss\Flywheel\Predicate::where