public function first() { $limit = $this->_limit; $offset = $this->_offset; $this->limit(1); $all = $this->all(); $first = ArrayMethods::first($all); if ($limit) { $this->_limit = $limit; } if ($offset) { $this->_offset = $offset; } return $first; }
/** * Run the select query for a supported SQL Aggregate function * @param string $method Aggregate function to be used * @param string $value Parameters to be used in SQl query * @return mixed Results of SQL query */ protected function _aggregate($method, $values) { $this->_aggregate = strtoupper($method); $this->_fields = array($values); $all = $this->all(); $aggregate = ArrayMethods::first($all); return $aggregate; }