You are here

class ValueUpdatedCommand in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/Ajax/ValueUpdatedCommand.php \Drupal\entity_browser\Ajax\ValueUpdatedCommand

AJAX command to refresh an entity_browser_entity_reference field widget.

Hierarchy

Expanded class hierarchy of ValueUpdatedCommand

1 file declares its use of ValueUpdatedCommand
EntityBrowserController.php in src/Controllers/EntityBrowserController.php

File

src/Ajax/ValueUpdatedCommand.php, line 10

Namespace

Drupal\entity_browser\Ajax
View source
class ValueUpdatedCommand implements CommandInterface {

  /**
   * The ID for the details element.
   *
   * @var string
   */
  protected $details_id;

  /**
   * Constructor.
   *
   * @param string $details_id
   *   The ID for the details element.
   */
  public function __construct($details_id) {
    $this->details_id = $details_id;
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    return [
      'command' => 'entity_browser_value_updated',
      'details_id' => $this->details_id,
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ValueUpdatedCommand::$details_id protected property The ID for the details element.
ValueUpdatedCommand::render public function Return an array to be run through json_encode and sent to the client. Overrides CommandInterface::render
ValueUpdatedCommand::__construct public function Constructor.