class Comment
Same name in this branch
- 9 core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment
- 9 core/modules/comment/src/Plugin/migrate/source/d6/Comment.php \Drupal\comment\Plugin\migrate\source\d6\Comment
- 9 core/modules/comment/src/Plugin/migrate/source/d7/Comment.php \Drupal\comment\Plugin\migrate\source\d7\Comment
- 9 core/modules/comment/tests/modules/d6_comment_test/src/Plugin/migrate/source/d6/Comment.php \Drupal\d6_comment_test\Plugin\migrate\source\d6\Comment
Same name and namespace in other branches
- 11.x core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment
- 11.x core/modules/comment/src/Plugin/views/wizard/Comment.php \Drupal\comment\Plugin\views\wizard\Comment
- 11.x core/modules/comment/src/Plugin/migrate/source/d6/Comment.php \Drupal\comment\Plugin\migrate\source\d6\Comment
- 11.x core/modules/comment/src/Plugin/migrate/source/d7/Comment.php \Drupal\comment\Plugin\migrate\source\d7\Comment
Tests creating comment views with the wizard.
Plugin annotation
@ViewsWizard(
id = "comment",
base_table = "comment_field_data",
title = @Translation("Comments")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\views\Plugin\views\wizard\WizardPluginBase extends \Drupal\views\Plugin\views\wizard\WizardInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\comment\Plugin\views\wizard\Comment implements \Drupal\views\Plugin\views\wizard\WizardPluginBase
- class \Drupal\views\Plugin\views\wizard\WizardPluginBase extends \Drupal\views\Plugin\views\wizard\WizardInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of Comment
348 string references to 'Comment'
- ActionTest::providerSource in core/
modules/ system/ tests/ src/ Kernel/ Plugin/ migrate/ source/ ActionTest.php - AuthorNameFormatter::isApplicable in core/
modules/ comment/ src/ Plugin/ Field/ FieldFormatter/ AuthorNameFormatter.php - BigPipeRegressionTest::testCommentForm_2698811 in core/
modules/ ckeditor/ tests/ src/ FunctionalJavascript/ BigPipeRegressionTest.php - Ensure comment form works with history and big_pipe modules.
- CategoryAutocompleteTest::providerTestAutocompleteSuggestions in core/
modules/ block/ tests/ src/ Unit/ CategoryAutocompleteTest.php - Data provider for testAutocompleteSuggestions().
- CategoryAutocompleteTest::setUp in core/
modules/ block/ tests/ src/ Unit/ CategoryAutocompleteTest.php
File
-
core/
modules/ comment/ src/ Plugin/ views/ wizard/ Comment.php, line 20
Namespace
Drupal\comment\Plugin\views\wizardView source
class Comment extends WizardPluginBase {
/**
* Set the created column.
*
* @var string
*/
protected $createdColumn = 'created';
/**
* Set default values for the filters.
*/
protected $filters = [
'status_node' => [
'value' => TRUE,
'table' => 'node_field_data',
'field' => 'status',
'plugin_id' => 'boolean',
'relationship' => 'node',
'entity_type' => 'node',
'entity_field' => 'status',
],
];
/**
* {@inheritdoc}
*/
protected function rowStyleOptions() {
$options = [];
$options['entity:comment'] = $this->t('comments');
$options['fields'] = $this->t('fields');
return $options;
}
/**
* {@inheritdoc}
*/
protected function defaultDisplayOptions() {
$display_options = parent::defaultDisplayOptions();
// Add permission-based access control.
$display_options['access']['type'] = 'perm';
$display_options['access']['options']['perm'] = 'access comments';
// Add a relationship to nodes.
$display_options['relationships']['node']['id'] = 'node';
$display_options['relationships']['node']['table'] = 'comment_field_data';
$display_options['relationships']['node']['field'] = 'node';
$display_options['relationships']['node']['entity_type'] = 'comment_field_data';
$display_options['relationships']['node']['required'] = 1;
$display_options['relationships']['node']['plugin_id'] = 'standard';
// Remove the default fields, since we are customizing them here.
unset($display_options['fields']);
/* Field: Comment: Title */
$display_options['fields']['subject']['id'] = 'subject';
$display_options['fields']['subject']['table'] = 'comment_field_data';
$display_options['fields']['subject']['field'] = 'subject';
$display_options['fields']['subject']['entity_type'] = 'comment';
$display_options['fields']['subject']['entity_field'] = 'subject';
$display_options['fields']['subject']['label'] = '';
$display_options['fields']['subject']['alter']['alter_text'] = 0;
$display_options['fields']['subject']['alter']['make_link'] = 0;
$display_options['fields']['subject']['alter']['absolute'] = 0;
$display_options['fields']['subject']['alter']['trim'] = 0;
$display_options['fields']['subject']['alter']['word_boundary'] = 0;
$display_options['fields']['subject']['alter']['ellipsis'] = 0;
$display_options['fields']['subject']['alter']['strip_tags'] = 0;
$display_options['fields']['subject']['alter']['html'] = 0;
$display_options['fields']['subject']['hide_empty'] = 0;
$display_options['fields']['subject']['empty_zero'] = 0;
$display_options['fields']['subject']['plugin_id'] = 'field';
$display_options['fields']['subject']['type'] = 'string';
$display_options['fields']['subject']['settings'] = [
'link_to_entity' => TRUE,
];
return $display_options;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.