You are here

class Pagerer in Pagerer 8.2

Same name in this branch
  1. 8.2 src/Pagerer.php \Drupal\pagerer\Pagerer
  2. 8.2 src/Plugin/views/pager/Pagerer.php \Drupal\pagerer\Plugin\views\pager\Pagerer
Same name and namespace in other branches
  1. 8 src/Pagerer.php \Drupal\pagerer\Pagerer

Pagerer pager value object.

Hierarchy

  • class \Drupal\Core\Pager\Pager

Expanded class hierarchy of Pagerer

3 files declare their use of Pagerer
Multipane.php in src/Plugin/pagerer/Multipane.php
PagererStyleBase.php in src/Plugin/pagerer/PagererStyleBase.php
PagererStyleInterface.php in src/Plugin/PagererStyleInterface.php
3 string references to 'Pagerer'
pagerer.info.yml in ./pagerer.info.yml
pagerer.info.yml
pagerer.links.menu.yml in ./pagerer.links.menu.yml
pagerer.links.menu.yml
pagerer.routing.yml in ./pagerer.routing.yml
pagerer.routing.yml

File

src/Pagerer.php, line 10

Namespace

Drupal\pagerer
View source
class Pagerer extends Pager {

  /**
   * The pager element.
   *
   * This is the index used by query extenders to identify the query to be
   * paged, and reflected in the 'page=x,y,z' query parameter of the HTTP
   * request.
   *
   * @var int
   */
  protected $element;

  /**
   * The route name.
   *
   * @var string
   */
  protected $routeName;

  /**
   * The route parameters.
   *
   * @var string[]
   */
  protected $routeParameters = [];

  /**
   * The pager adaptive keys.
   *
   * @var string
   */
  protected $adaptiveKeys;

  /**
   * Gets the route name for this pager.
   *
   * @return string
   *   The route name.
   */
  public function getRouteName() {
    return $this->routeName;
  }

  /**
   * Sets the route name for this pager.
   *
   * @param string $route_name
   *   The route name.
   *
   * @return self
   *   Self.
   */
  public function setRouteName($route_name) : self {
    $this->routeName = $route_name;
    return $this;
  }

  /**
   * Gets the route parameters for this pager.
   *
   * @return string[]
   *   The route parameters.
   */
  public function getRouteParameters() : array {
    return $this->routeParameters;
  }

  /**
   * Sets the route parameters for this pager.
   *
   * @param string[] $route_parameters
   *   The route parameters.
   *
   * @return self
   *   Self.
   */
  public function setRouteParameters(array $route_parameters) : self {
    $this->routeParameters = $route_parameters;
    return $this;
  }

  /**
   * Gets the pager element.
   *
   * @return int
   *   The pager element.
   */
  public function getElement() : int {
    return $this->element;
  }

  /**
   * Sets the pager element.
   *
   * @param int $element
   *   The pager element.
   *
   * @return self
   *   Self.
   */
  public function setElement(int $element) : self {
    $this->element = $element;
    return $this;
  }

  /**
   * Gets last page in the pager (zero-index).
   *
   * @return int
   *   The index of the last page in the pager.
   */
  public function getLastPage() : int {
    return $this->totalPages - 1;
  }

  /**
   * Gets the adaptive keys of this pager.
   *
   * Used by the Adaptive pager style.
   *
   * @return array
   *   The adaptive keys array, in the format 'L,R,X', where L is the
   *   adaptive lock to left page, R is the adaptive lock to right page,
   *   and X is the adaptive center lock for calculation of neighborhood.
   */
  public function getAdaptiveKeys() : array {
    return $this->adaptiveKeys;
  }

  /**
   * Sets the adaptive keys of this pager.
   *
   * Used by the Adaptive pager style.
   *
   * @param array $adaptive_keys
   *   The adaptive keys array, in the format 'L,R,X', where L is the adaptive
   *   lock to left page, R is the adaptive lock to right page, and X is the
   *   adaptive center lock for calculation of neighborhood.
   *
   * @return self
   *   Self.
   */
  public function setAdaptiveKeys(array $adaptive_keys) : self {
    $this->adaptiveKeys = $adaptive_keys;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Pager::$currentPage protected property The current page of the pager.
Pager::$limit protected property The maximum number of items per page.
Pager::$totalItems protected property The total number of items .
Pager::$totalPages protected property The total number of pages.
Pager::getCurrentPage public function Gets the current page.
Pager::getLimit public function Gets the maximum number of items per page.
Pager::getTotalItems public function Gets the total number of items.
Pager::getTotalPages public function Gets the total number of pages.
Pager::setCurrentPage protected function Sets the current page to a valid value within range.
Pager::setTotalPages protected function Sets the total number of pages.
Pager::__construct public function Pager constructor.
Pagerer::$adaptiveKeys protected property The pager adaptive keys.
Pagerer::$element protected property The pager element.
Pagerer::$routeName protected property The route name.
Pagerer::$routeParameters protected property The route parameters.
Pagerer::getAdaptiveKeys public function Gets the adaptive keys of this pager.
Pagerer::getElement public function Gets the pager element.
Pagerer::getLastPage public function Gets last page in the pager (zero-index).
Pagerer::getRouteName public function Gets the route name for this pager.
Pagerer::getRouteParameters public function Gets the route parameters for this pager.
Pagerer::setAdaptiveKeys public function Sets the adaptive keys of this pager.
Pagerer::setElement public function Sets the pager element.
Pagerer::setRouteName public function Sets the route name for this pager.
Pagerer::setRouteParameters public function Sets the route parameters for this pager.