You are here

trait QueueBasePageTrait in Purge 8.3

Adds default selectPage* method implementations to queue implementations.

Hierarchy

File

src/Plugin/Purge/Queue/QueueBasePageTrait.php, line 8

Namespace

Drupal\purge\Plugin\Purge\Queue
View source
trait QueueBasePageTrait {

  /**
   * The configured limit of items on selected data pages.
   *
   * @var int
   */
  protected $selectPageLimit = 15;

  /**
   * {@inheritdoc}
   */
  public function selectPageLimit($set_limit_to = NULL) {
    if (is_int($set_limit_to)) {
      $this->selectPageLimit = $set_limit_to;
    }
    return $this->selectPageLimit;
  }

  /**
   * {@inheritdoc}
   */
  public function selectPageMax() {
    $max = (int) $this
      ->numberOfItems() / $this
      ->selectPageLimit();
    return intval(ceil($max));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
QueueBasePageTrait::$selectPageLimit protected property The configured limit of items on selected data pages.
QueueBasePageTrait::selectPageLimit public function
QueueBasePageTrait::selectPageMax public function