/** * Calculates the total number of data items. * * @return int the total number of data items. */ protected function calculateTotalItemCount() { // Count all $total = $this->collection->count(); // Make a pagination $pagination = $this->getPagination(); // Set total item in pagination $pagination->setItemCount($total); // Set a new pagination instance $this->setPagination($pagination); return $total; }