Back to ListModel class

Method getPagination

public \Joomla\CMS\Pagination\Pagination
getPagination
()
Method to get a \JPagination object for the data set.
Returns
  • \Joomla\CMS\Pagination\Pagination A Pagination object for the data set.
Since
  • 1.6
Class: ListModel
Project: Joomla

Method getPagination - Source code

/**
 * Method to get a \JPagination object for the data set.
 *
 * @return  Pagination  A Pagination object for the data set.
 *
 * @since   1.6
 */
public function getPagination()
{
    // Get a storage key.
    $store = $this->getStoreId('getPagination');
    // Try to load the data from internal storage.
    if (isset($this->cache[$store])) {
        return $this->cache[$store];
    }
    $limit = (int) $this->getState('list.limit') - (int) $this->getState('list.links');
    // Create the pagination object and add the object to the internal cache.
    $this->cache[$store] = new Pagination($this->getTotal(), $this->getStart(), $limit);
    return $this->cache[$store];
}