You are here

class AlterEntityBrowserDisplayData in Entity Browser 8

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

Allows data for an entity browser element to be altered.

Hierarchy

Expanded class hierarchy of AlterEntityBrowserDisplayData

2 files declare their use of AlterEntityBrowserDisplayData
IFrame.php in src/Plugin/EntityBrowser/Display/IFrame.php
Modal.php in src/Plugin/EntityBrowser/Display/Modal.php

File

src/Events/AlterEntityBrowserDisplayData.php, line 10

Namespace

Drupal\entity_browser\Events
View source
class AlterEntityBrowserDisplayData extends EventBase {

  /**
   * Data to process.
   *
   * @var array
   */
  protected $data;

  /**
   * Form state object.
   *
   * @var \Drupal\Core\Form\FormStateInterface
   */
  protected $formState;

  /**
   * Plugin definition.
   *
   * @var array
   */
  protected $pluginDefinition;

  /**
   * Constructs a EntitySelectionEvent object.
   *
   * @param string $entity_browser_id
   *   Entity browser ID.
   * @param string $instance_uuid
   *   Entity browser instance UUID.
   * @param array $plugin_definition
   *   Plugin definition.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   Form state object.
   * @param array $data
   *   Data to process.
   */
  public function __construct($entity_browser_id, $instance_uuid, array $plugin_definition, FormStateInterface $form_state, array $data) {
    parent::__construct($entity_browser_id, $instance_uuid);
    $this->data = $data;
    $this->formState = $form_state;
    $this->pluginDefinition = $plugin_definition;
  }

  /**
   * Gets form state.
   *
   * @return \Drupal\Core\Form\FormStateInterface
   *   Form state object.
   */
  public function getFormState() {
    return $this->formState;
  }

  /**
   * Gets data array.
   *
   * @return array
   *   Data array.
   */
  public function getData() {
    return $this->data;
  }

  /**
   * Gets plugin definition array.
   *
   * @return array
   *   Plugin definition array.
   */
  public function getPluginDefinition() {
    return $this->pluginDefinition;
  }

  /**
   * Sets data array.
   *
   * @param array $data
   *   Data array.
   */
  public function setData($data) {
    $this->data = $data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AlterEntityBrowserDisplayData::$data protected property Data to process.
AlterEntityBrowserDisplayData::$formState protected property Form state object.
AlterEntityBrowserDisplayData::$pluginDefinition protected property Plugin definition.
AlterEntityBrowserDisplayData::getData public function Gets data array.
AlterEntityBrowserDisplayData::getFormState public function Gets form state.
AlterEntityBrowserDisplayData::getPluginDefinition public function Gets plugin definition array.
AlterEntityBrowserDisplayData::setData public function Sets data array.
AlterEntityBrowserDisplayData::__construct public function Constructs a EntitySelectionEvent object. Overrides EventBase::__construct
EventBase::$entityBrowserID protected property Entity browser id.
EventBase::$instanceUUID protected property Entity browser instance UUID.
EventBase::getBrowserID public function Gets the entity browser ID:.
EventBase::getBrowserInstanceUUID public function Gets the entity browser instance UUID:.