You are here

class ErlStateResetCommand in Entity Reference with Layout 8

Class ErlState.

Hierarchy

Expanded class hierarchy of ErlStateResetCommand

1 file declares its use of ErlStateResetCommand
EntityReferenceLayoutWidget.php in src/Plugin/Field/FieldWidget/EntityReferenceLayoutWidget.php

File

src/Ajax/ErlStateResetCommand.php, line 10

Namespace

Drupal\entity_reference_layout\Ajax
View source
class ErlStateResetCommand 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' => 'resetErlState',
      'data' => [
        "id" => $this->id,
      ],
    ];
  }

}

Members

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