public function getFirst() { if (is_array($this->rows)) { $rows =& $this->rows; } else { $query = clone $this->query; $query->setLimit(1); $rows = $query->getResult(); } return isset($rows[0]) ? $rows[0] : null; }