You are here

LayoutParagraphsStateResetCommand.php in Layout Paragraphs 1.0.x

File

src/Ajax/LayoutParagraphsStateResetCommand.php
View source
<?php

namespace Drupal\layout_paragraphs\Ajax;

use Drupal\Core\Ajax\CommandInterface;

/**
 * Class LayoutParagraphsStateResetCommand.
 */
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,
      ],
    ];
  }

}

Classes

Namesort descending Description
LayoutParagraphsStateResetCommand Class LayoutParagraphsStateResetCommand.