/** * Adds the <tt>ORDER BY</tt> and <tt>LIMIT</tt> clauses to the given SQL query, and returns * that query for convenience. * * @param \Cantiga\Metamodel\QueryBuilder $qb * @return \Cantiga\Metamodel\QueryBuilder */ public function processQuery(QueryBuilder $qb) { $qb->limit($this->length, $this->start); if (sizeof($this->orders) > 0) { $qb->resetOrders(); foreach ($this->orders as $order) { $qb->orderBy($order['dbName'], $order['direction']); } } return $qb; }