class LastTimestamp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/comment/src/Plugin/views/field/LastTimestamp.php \Drupal\comment\Plugin\views\field\LastTimestamp
- 9 core/modules/comment/src/Plugin/views/field/LastTimestamp.php \Drupal\comment\Plugin\views\field\LastTimestamp
Field handler to display the timestamp of a comment with the count of comments.
Plugin annotation
@ViewsField("comment_last_timestamp");
Hierarchy
- class \Drupal\views\Plugin\views\field\Date extends \Drupal\views\Plugin\views\field\FieldPluginBase
- class \Drupal\comment\Plugin\views\field\LastTimestamp
Expanded class hierarchy of LastTimestamp
File
- core/
modules/ comment/ src/ Plugin/ views/ field/ LastTimestamp.php, line 17
Namespace
Drupal\comment\Plugin\views\fieldView source
class LastTimestamp extends Date {
/**
* {@inheritdoc}
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
$this->additional_fields['comment_count'] = 'comment_count';
}
/**
* {@inheritdoc}
*/
public function render(ResultRow $values) {
$comment_count = $this
->getValue($values, 'comment_count');
if (empty($this->options['empty_zero']) || $comment_count) {
return parent::render($values);
}
else {
return NULL;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Date:: |
protected | property | The date format storage. | |
Date:: |
protected | property | The date formatter service. | |
Date:: |
public | function | ||
Date:: |
public static | function | ||
Date:: |
protected | function | ||
Date:: |
public | function | Constructs a new Date object. | |
LastTimestamp:: |
public | function | ||
LastTimestamp:: |
public | function |
Overrides Date:: |