You are here

public function EntityPagerOut::getEntityPager in Entity Pager 7

Entity Pager return links.

The main method for returning links & counts etc.. for Entity Pager. Use this to get Entity Pager links.

Return value

array|bool|void Get the results for an entity pager.

File

includes/EntityPagerOut.inc, line 29
Provides the Business Logic for the EntityPager module.

Class

EntityPagerOut
Class EntityPagerOut.

Code

public function getEntityPager() {
  $entity = $this
    ->getEntity();
  $view = $this
    ->getView();
  $settings = $this
    ->getSettings($view);
  if (!$entity) {
    $this
      ->runAdviceLogic('no-records', 'No Entity on page');
    return FALSE;
  }
  $entity_type = $this
    ->getEntityInfo('entity_type');

  // Process to 'All' link.
  $this
    ->tokenLink($entity_type, $entity, $settings['next_prev']['link_all_url'], $settings['next_prev']['link_all_text']);

  // Create links for 'Next', 'All' and 'Prev' values.
  $links = $this
    ->calculateNextAllPrevValuesFromView($entity, $view);
  return $links;
}