NodeComment.php in Views (for Drupal 7) 8.3
Definition of Views\comment\Plugin\views\field\NodeComment.
Namespace
Views\comment\Plugin\views\fieldFile
lib/Views/comment/Plugin/views/field/NodeComment.phpView source
<?php
/**
* @file
* Definition of Views\comment\Plugin\views\field\NodeComment.
*/
namespace Views\comment\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Core\Annotation\Plugin;
/**
* Display node comment status.
*
* @ingroup views_field_handlers
*
* @Plugin(
* id = "node_comment",
* module = "comment"
* )
*/
class NodeComment extends FieldPluginBase {
function render($values) {
$value = $this
->get_value($values);
switch ($value) {
case COMMENT_NODE_HIDDEN:
default:
return t('Hidden');
case COMMENT_NODE_CLOSED:
return t('Closed');
case COMMENT_NODE_OPEN:
return t('Open');
}
}
}
Classes
Name | Description |
---|---|
NodeComment | Display node comment status. |