class SaveComment

Saves a comment.

Plugin annotation


@Action(
  id = "comment_save_action",
  label = @Translation("Save comment"),
  type = "comment"
)

Hierarchy

Expanded class hierarchy of SaveComment

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/Action/SaveComment.php, line 24
Contains \Drupal\comment\Plugin\Action\SaveComment.

Namespace

Drupal\comment\Plugin\Action
View source
class SaveComment extends ActionBase {

  /**
   * {@inheritdoc}
   */
  public function execute($comment = NULL) {
    $comment
      ->save();
    Cache::invalidateTags(array(
      'content' => TRUE,
    ));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ActionBase::executeMultiple public function Executes the plugin for an array of objects. Overrides ActionInterface::executeMultiple 2
ContainerFactoryPluginBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create 11
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin_id.
PluginBase::getPluginDefinition public function Returns the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition
PluginBase::getPluginId public function Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::__construct public function Constructs a Drupal\Component\Plugin\PluginBase object. 17
SaveComment::execute public function Executes the plugin. Overrides ExecutableInterface::execute