Returns first item.

@return AcceptHeaderItem|null
438810
public function first()
    {
        $this->sort();

        return !empty($this->items) ? reset($this->items) : null;
    }
593920
public function first()
    {
        try {
            $row = $this->baseQuery->first();

            if ($row === null) {
                return $row;
            } else {
                return $this->processFetchedRow($row);
            }
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
947997
public function first ()
	{
		if (!is_array($this->data)) return $this->data;
		if (!count($this->data)) return null;
		reset($this->data);
		return $this->data[key($this->data)];
	}
234237
public function getFirst()
    {
        if (count($this->children)) {
            reset($this->children);
            return current($this->children);
        } else {
            return null;
        }
    }
1189601
@Override
	public String getFirst(String headerName) {
		List<String> headerValues = headers.get(headerName);
		return headerValues != null ? headerValues.get(0) : null;
	}
1150288
public static function first()
    {
        $self      = self::getInstance();

        $statement = $self->makeSelect();
        $execute   = $self->exec($statement, []);

        return $execute->fetchObject();
    }
579021
public function findFirst()
    {
        $rowset = $this->getTableGateway()
            ->select(
                function(Select $select) {
                    $select->columns($this->columns);
                    $select->limit(1);
                    $select->order('id asc');
                }
            );
        $row = $rowset->current();
        if (!$row) {
            return NULL;
        }
        return $row;
    }
675836
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;
    }
1342913
public function first()
    {
        $response =  $this->httpGetRequest($this->buildUrl());

        if (empty($response->data[0])) {
            return false;
        }

        return $response->data[0];
    }
1114960
public function first() {
		$this->limit(1);
		$result = $this->find();
		return empty($result) ? null : $result[0];
	}
687668
public function first()
    {
        $events = $this->_entity->getEventManager();
        $event = new SelectEvent(
            [
                'sqlQuery' => &$this,
                'params' => [],
                'action' => SelectEvent::FIND_FIRST,
                'singleItem' => true
            ]
        );
        $events->trigger(SelectEvent::BEFORE_SELECT, $this->_entity, $event);
        $row = parent::first();
        $event->data = $row;
        $events->trigger(SelectEvent::AFTER_SELECT, $this->_entity, $event);
        $class = $this->_entity->getClassName();
        return new $class($row);
    }
1255771
protected function NextItem()
	{
		while (true)
		{
			if ( ! $this->accept)
			{
				if ( ! $this->MoveNextIter() )
					return null;
				$this->nav = $this->curr->CloneInstance();
				$this->curr->MoveToRoot();
			}
			$this->accept = $this->curr->MoveToFollowing( $this->kind, $this->nav );
			if ( $this->accept )
			{
				if ( $this->curr->isNodeAncestorOf( $this->nav ) ) continue;

				if ( $this->TestItem() )
				{
					$this->sequentialPosition++;
					return $this->curr;
				}
			}
		}
	}
916669
public function first()
    {
        $results = $this->filter('', '', '', ['$top'=> 1]);
        $result = is_array($results) && count($results) > 0 ? $results[0] : null;

        return $result;
    }
531569
public function first()
    {
        $this->limit(1);
        $result = $this->get();
        return empty($result) ? null : $result[0];
    }
1220285
public function first()
    {
        if (!empty($this->data)) {
            if (Collection::count($this->data) > 0) {
                return $this->data[0];
            } else {
                return;
            }
        } else {
            return;
        }
    }
119913
public function first()
    {
        $item = reset($this->items);
        if (is_numeric($item)) {
            $item = DataObject::get_by_id($this->dataClass, $item);
        }
        if (!empty($this->extraFields[key($this->items)])) {
            $item->update($this->extraFields[key($this->items)]);
        }
        return $item;
    }
229974
protected function NextItem()
	{
		while (true)
		{
			if ( ! $this->accept )
			{
				if ( ! $this->MoveNextIter() )
				{
					return null;
				}
				$this->first = true;
				if ( $this->matchSelf && $this->TestItem() )
				{
					$this->sequentialPosition++;
					return $this->curr;
				}
			}
			if ( $this->first)
			{
				$this->accept = $this->MoveToFirst( $this->curr );
				$this->first = false;
			}
			else
			{
				$this->accept = $this->MoveToNext( $this->curr );
			}
			if ( $this->accept )
			{
				if ( $this->TestItem() )
				{
					$this->sequentialPosition++;
					return $this->curr;
				}
			}
		}
	}