Beispiel #1
0
 /**
  * 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);
 }
Beispiel #2
0
 /**
  * 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);
 }