Returns the last item of the collection.

@return mixed

@throws OutOfBoundsException when the collection is empty.
770026
public function last()
    {
        if (empty($this->data)) {
            throw new OutOfBoundsException('Can\'t determine last item. Collection is empty');
        }

        $item = \end($this->data);
        \reset($this->data);

        return $item;
    }
695004
public E getLast() {
        final Node<E> l = last;
        if (l == null)
            throw new NoSuchElementException();
        return l.item;
    }
242830
public function current()
    {
        if (!isset($this->tokens[$this->position])) {
            throw $this->getOutOfBoundsException();
        }

        return $this->tokens[$this->position];
    }
551347
public function getTo()
    {
        if ($this->getExclusive()) {
            $values = range($this->from, $this->to);
            array_pop($values);

            return end($values);
        }

        return $this->to;
    }
1158006
public function getLast()
    {
        $result = $this->table()
            ->where('batch', $this->getLastBatchNumber())
            ->orderBy('mapping', 'desc')
            ->get();

        if (is_array($result)) {
            return $result;
        }

        return $result->toArray();
    }
88670
public function getLastPage()
    {
        return $this->hasResults() ? ceil($this->adapter->getTotalResults() / $this->limit) : $this->getFirstPage();
    }
919969
public function LastItem()
    {
        $pageLength = $this->getPageLength();
        if (!$pageLength) {
            return $this->getTotalItems();
        } elseif ($start = $this->getPageStart()) {
            return min($start + $pageLength, $this->getTotalItems());
        } else {
            return min($pageLength, $this->getTotalItems());
        }
    }
381985
public function getLastCategoryPur()
    {
        $lastOrderId = $this->model->getLastOrderId();
        $order = $this->orderFactory->create();
        $this->orderResource->load($order, $lastOrderId);
        $categoryIds = $this->getCategoriesFromOrderItems($order->getAllItems());

        return $this->getCategoryNames($categoryIds);
    }
151663
public function get(string $data)
    {
        $entry = $this->data->get($data);

        if (is_null($entry)) {
            throw new \OutOfBoundsException("{$entry} is a invalid key for closure shared data");
        }

        return $entry;
    }
675100
public function lastKey()
    {
        $keys = AccessHelper::collectionKeys($this->data);

        if (empty($keys) || end($keys) === false) {
            return null;
        }

        return end($keys);
    }
952398
public function getLast($primaryKey)
    {
        if (!isset($this->values[$primaryKey])) {
            throw new OutOfBoundsException(sprintf(
                'The key "%s" does not exist.',
                $primaryKey
            ));
        }

        return end($this->values[$primaryKey]);
    }
528917
public function last()
    {
        if ($this->isEmpty()) {
            return null;
        }

        $lastItem = array_slice($this->container, -1, 1);

        return current($lastItem);
    }
843755
public function getLast()
    {
        $this->internalDataListUpdate();
        $count = sizeof($this->internalDataListData);
        if (isset($this->internalDataListData[$count - 1])) {
            return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $count - 1);
        }
        return null;
    }
713175
protected function getLastValidItem()
    {
        $validItems = $this->getValidItems();
        $result = null;
        if( !empty( $validItems ) )
        {
            $result = null;
            $lastTime = 0;
            foreach($validItems as $item)
            {
                if( $item -> attribute( 'ts_visible' ) >= $lastTime)
                {
                    $lastTime = $item -> attribute( 'ts_visible' );
                    $result = $item;
                }
            }
        }
        return $result;
    }
1332998
public function getNext()
	{
		if (! $this->valid()) {
			throw new \OutOfBoundsException('End of iterator reached.');
		}

		$value = $this->get($this->key());

		$this->next();

		return $value;
	}
636083
function last() {
		return $this->skip(($ofs=count($this->query)-$this->ptr)?$ofs-1:0);
	}
628741
public function getLastPage()
    {
        $perPage = max($this->paginatedResult->getQuery()->getItemsPerPage(), 1);
        $total = $this->getTotal();
        $pageCount = $total / $perPage;

        if (round($pageCount, 1) - round($pageCount, 0) > 0) {
            return round($pageCount, 0) + 1;
        }

        return round($pageCount, 0);
    }