class UnapprovedComments
Same name in other branches
- 9 core/modules/comment/src/Plugin/Menu/LocalTask/UnapprovedComments.php \Drupal\comment\Plugin\Menu\LocalTask\UnapprovedComments
- 8.9.x core/modules/comment/src/Plugin/Menu/LocalTask/UnapprovedComments.php \Drupal\comment\Plugin\Menu\LocalTask\UnapprovedComments
- 10 core/modules/comment/src/Plugin/Menu/LocalTask/UnapprovedComments.php \Drupal\comment\Plugin\Menu\LocalTask\UnapprovedComments
Provides a local task that shows the amount of unapproved comments.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Menu\LocalTaskDefault extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Core\Menu\LocalTaskInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\comment\Plugin\Menu\LocalTask\UnapprovedComments extends \Drupal\Core\Menu\LocalTaskDefault implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface uses \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\Core\Menu\LocalTaskDefault extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Core\Menu\LocalTaskInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait
Expanded class hierarchy of UnapprovedComments
1 string reference to 'UnapprovedComments'
- comment.links.task.yml in core/
modules/ comment/ comment.links.task.yml - core/modules/comment/comment.links.task.yml
File
-
core/
modules/ comment/ src/ Plugin/ Menu/ LocalTask/ UnapprovedComments.php, line 15
Namespace
Drupal\comment\Plugin\Menu\LocalTaskView source
class UnapprovedComments extends LocalTaskDefault implements ContainerFactoryPluginInterface {
use StringTranslationTrait;
/**
* The comment storage service.
*
* @var \Drupal\comment\CommentStorageInterface
*/
protected $commentStorage;
/**
* Construct the UnapprovedComments object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\comment\CommentStorageInterface $comment_storage
* The comment storage service.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, CommentStorageInterface $comment_storage) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->commentStorage = $comment_storage;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity_type.manager')
->getStorage('comment'));
}
/**
* {@inheritdoc}
*/
public function getTitle(?Request $request = NULL) {
return $this->t('Unapproved comments (@count)', [
'@count' => $this->commentStorage
->getUnapprovedCount(),
]);
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.