You are here

public function WordCount::render in Translation Management Tool 8

Same name in this branch
  1. 8 src/Plugin/views/field/WordCount.php \Drupal\tmgmt\Plugin\views\field\WordCount::render()
  2. 8 translators/tmgmt_local/src/Plugin/views/field/WordCount.php \Drupal\tmgmt_local\Plugin\views\field\WordCount::render()

Renders the field.

Parameters

\Drupal\views\ResultRow $values: The values retrieved from a single row of a view's query result.

Return value

string|\Drupal\Component\Render\MarkupInterface The rendered output. If the output is safe it will be wrapped in an object that implements MarkupInterface. If it is empty or unsafe it will be a string.

Overrides FieldPluginBase::render

File

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

Class

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

Namespace

Drupal\tmgmt\Plugin\views\field

Code

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