where() public method

See also: Query::andWhere
public where ( $field, $operator = null, $value = null ) : Query
return Query The same instance of this class.
示例#1
0
 public function testPredicate()
 {
     $path = __DIR__ . '/fixtures/datastore/querytest';
     $config = new Config($path . '/');
     $repo = new Repository('countries', $config);
     $query = new Query($repo);
     $query->where('cca2', '==', 'GB');
     $predicate = new Predicate();
     $predicate->where('cca2', '==', 'GB');
     $this->assertAttributeEquals($predicate, 'predicate', $query);
 }
示例#2
0
 public function testWhereMultiDimensionalIndex()
 {
     $path = __DIR__ . '/fixtures/datastore/querytest';
     $config = new Config($path . '/');
     $repo = new Repository('multidimensionalindex', $config);
     $query = new Query($repo);
     $query->where('Tags.0.Key', '==', 'aws:autoscaling:groupName');
     $result = $query->execute();
     $this->assertInstanceOf('\\JamesMoss\\Flywheel\\Result', $result);
     $this->assertEquals(1, count($result));
     $this->assertEquals(1, $result->total());
 }