/** * Executes a SELECT query and returns the first row of the result set. * * @access public * @return mixed */ public function first() { $query = $this->limit(1)->compiler->select(); return $this->connection->first($query['sql'], $query['params'], static::FETCH_MODE); }
/** * Executes a SELECT query and returns the first row of the result set. * * @access public * @param mixed ...$fetchMode Fetch mode * @return mixed */ protected function fetchFirst(...$fetchMode) { $query = $this->limit(1)->compiler->select(); return $this->connection->first($query['sql'], $query['params'], ...$fetchMode); }