moderation_note-8.x-1.0-beta3/src/Ajax/RemoveModerationNoteCommand.php
src/Ajax/RemoveModerationNoteCommand.php
<?php
namespace Drupal\moderation_note\Ajax;
use Drupal\Core\Ajax\CommandInterface;
use Drupal\moderation_note\ModerationNoteInterface;
/**
* AJAX command to remove a Moderation Note.
*/
class RemoveModerationNoteCommand implements CommandInterface {
/**
* The Moderation Note.
*
* @var \Drupal\moderation_note\ModerationNoteInterface
*/
protected $moderationNote;
/**
* Constructs a RemoveModerationNoteCommand object.
*
* @param \Drupal\moderation_note\ModerationNoteInterface $moderation_note
* The Moderation Note.
*/
public function __construct(ModerationNoteInterface $moderation_note) {
$this->moderationNote = $moderation_note;
}
/**
* Implements \Drupal\Core\Ajax\CommandInterface::render().
*/
public function render() {
return [
'command' => 'remove_moderation_note',
'id' => $this->moderationNote->id(),
];
}
}
