LayoutParagraphsEventCommand.php in Layout Paragraphs 2.0.x
File
src/Ajax/LayoutParagraphsEventCommand.php
View source
<?php
namespace Drupal\layout_paragraphs\Ajax;
use Drupal\Core\Ajax\CommandInterface;
class LayoutParagraphsEventCommand implements CommandInterface {
protected $layout;
protected $componentUuid;
protected $eventName;
public function __construct($layout, $component_uuid, $event_name) {
$this->layout = $layout;
$this->componentUuid = $component_uuid;
$this->eventName = $event_name;
}
public function render() {
return [
'command' => 'LayoutParagraphsEventCommand',
'layoutId' => $this->layout
->id(),
'componentUuid' => $this->componentUuid,
'eventName' => $this->eventName,
];
}
}