class WordCount

Same name in this branch
  1. 8.x-1.x src/Plugin/views/field/WordCount.php \Drupal\tmgmt\Plugin\views\field\WordCount
  2. 8.x-1.x translators/tmgmt_local/src/Plugin/views/field/WordCount.php \Drupal\tmgmt_local\Plugin\views\field\WordCount

Field handler which shows the word count for a job or job item.

Plugin annotation

@ViewsField("tmgmt_local_wordcount");

Hierarchy

  • class \Drupal\tmgmt\Plugin\views\field\StatisticsBase extends \Drupal\views\Plugin\views\field\FieldPluginBase
    • class \Drupal\tmgmt_local\Plugin\views\field\WordCount

Expanded class hierarchy of WordCount

File

translators/tmgmt_local/src/Plugin/views/field/WordCount.php, line 13

Namespace

Drupal\tmgmt_local\Plugin\views\field
View source
class WordCount extends StatisticsBase {

  /**
   * {@inheritdoc}
   */
  public function render(ResultRow $values) {

    /** @var \Drupal\tmgmt_local\LocalTaskInterface $entity */
    $entity = $values->_entity;
    return $entity
      ->getWordCount();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
StatisticsBase::preRender public function Prefetch statistics for all jobs.
WordCount::render public function