List Model

It is a method to get the starting number of items for the data set.

  • return integer - The starting number of items available in the data set.
public function getStart()
{
$store = $this->getStoreId('getstart');

// Try to load the data from internal storage.
if (isset($this->cache[$store]))
{
return $this->cache[$store];
}

$start = $this->getState('list.start');

if ($start > 0)
{
$limit = $this->getState('list.limit');
$total = $this->getTotal();

if ($start > $total - $limit)
{
$start = max(0, (int) (ceil($total / $limit) - 1) * $limit);
}
}

// Add the total to the internal cache.
$this->cache[$store] = $start;

return $this->cache[$store];
}