You are here

public function EntityPager::getCountWord in Entity Pager 8

Same name and namespace in other branches
  1. 2.0.x src/EntityPager.php \Drupal\entity_pager\EntityPager::getCountWord()

Get result count word.

Get the word associated with the count of results. i.e. one, many The number in the result converted to a summary word for privacy.

Return value

string Get a text representation the number of records e.g. none, one or many.

Overrides EntityPagerInterface::getCountWord

File

src/EntityPager.php, line 79

Class

EntityPager
Entity pager object.

Namespace

Drupal\entity_pager

Code

public function getCountWord() {
  $count = 'invalid';
  if (isset($this
    ->getView()->total_rows)) {
    $total = $this
      ->getView()->total_rows;
    if ($total === 0) {
      $count = 'none';
    }
    elseif ($total === 1) {
      $count = 'one';
    }
    else {
      $count = 'many';
    }
  }
  return $count;
}