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_wordcount");

Hierarchy

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

Expanded class hierarchy of WordCount

File

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

Namespace

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

  /**
   * {@inheritdoc}
   */
  public function render(ResultRow $values) {
    $entity = $this
      ->getEntity($values);
    if ($entity instanceof JobInterface && $entity
      ->isContinuous()) {
      return;
    }
    return $entity
      ->getWordCount();
  }

}

Members

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