public function getByNameAndCategory($name, $category) { $qb = new QueryBuilder($this->getClient()); $qb->addWhere($qb->expr()->eq('name', $name))->addWhere($qb->expr()->neq('category', $category))->setMaxResults(10)->setFirstResult(0); $res = $qb->getQuery()->execute(); return $res['data']; }
public function getByNameAndCategory($name, $category) { $qb = new QueryBuilder($this->getClient()); $qb->addWhere($qb->expr()->eq('name', $name))->addWhere($qb->expr()->neq('category', $category))->setMaxResults(10)->setFirstResult(0); $res = $qb->getQuery()->execute(); return Collection::create('O3Co\\Query\\SampleClient\\Model', $res); }
public function testVisit() { $visitor = new ExpressionVisitor(); $qb = new QueryBuilder(); $qb->addWhere($qb->expr()->eq('foo', 'Foo'))->addWhere($qb->expr()->eq('bar', 'Bar'))->addOrder($qb->expr()->asc('foo'))->setMaxResults(1)->setFirstResult(1); $statement = $qb->getStatement(); $visitor->visitStatement($statement); $this->assertEquals('and:(foo:=:Foo bar:=:Bar)', $visitor->getQueryComponent('query')); $this->assertEquals('+foo', $visitor->getQueryComponent('order')); }