private function finalize() { if (is_null($this->mSelectQuery)) { throw new \Exception("query not initialized"); } if ($this->mOptimizeLiterals) { $this->mLogicalJunction = LogicalJunctionOptimizer::optimizeLiterals($this->mLogicalJunction); } $this->mSelectQuery->setWhereLogicalJunction($this->mLogicalJunction); $this->mSelectQuery->setLimit($this->mLoadLength)->setOffset($this->mOffset); $this->mSelectQuery->setFirstTableCurrentTable(); $this->_addColumns(); $this->_addGroupedColumns(); $this->_addOrderColumns(); }