You are here

class LayoutParagraphsStateResetCommand in Layout Paragraphs 1.0.x

Class LayoutParagraphsStateResetCommand.

Hierarchy

Expanded class hierarchy of LayoutParagraphsStateResetCommand

1 file declares its use of LayoutParagraphsStateResetCommand
LayoutParagraphsWidget.php in src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php

File

src/Ajax/LayoutParagraphsStateResetCommand.php, line 10

Namespace

Drupal\layout_paragraphs\Ajax
View source
class LayoutParagraphsStateResetCommand implements CommandInterface {

  /**
   * The wrapper DOM id.
   *
   * @var string
   */
  protected $id;

  /**
   * Constructs an ErlState instance.
   */
  public function __construct($id) {
    $this->id = $id;
  }

  /**
   * Render custom ajax command.
   *
   * @return ajax
   *   Command function.
   */
  public function render() {
    return [
      'command' => 'resetLayoutParagraphsState',
      'data' => [
        "id" => $this->id,
      ],
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LayoutParagraphsStateResetCommand::$id protected property The wrapper DOM id.
LayoutParagraphsStateResetCommand::render public function Render custom ajax command. Overrides CommandInterface::render
LayoutParagraphsStateResetCommand::__construct public function Constructs an ErlState instance.