You are here

class EntityBrowser in Entity Browser 8.2

Same name in this branch
  1. 8.2 src/Entity/EntityBrowser.php \Drupal\entity_browser\Entity\EntityBrowser
  2. 8.2 src/Plugin/views/display/EntityBrowser.php \Drupal\entity_browser\Plugin\views\display\EntityBrowser
Same name and namespace in other branches
  1. 8 src/Entity/EntityBrowser.php \Drupal\entity_browser\Entity\EntityBrowser

Defines an entity browser configuration entity.

Plugin annotation


@ConfigEntityType(
  id = "entity_browser",
  label = @Translation("Entity browser"),
  handlers = {
    "form" = {
      "entity_browser" = "Drupal\entity_browser\Form\EntityBrowserForm",
      "default" = "Drupal\entity_browser\Form\EntityBrowserEditForm",
      "edit" = "Drupal\entity_browser\Form\EntityBrowserEditForm",
      "delete" = "Drupal\entity_browser\Form\EntityBrowserDeleteForm",
      "edit_widgets" = "Drupal\entity_browser\Form\WidgetsConfig",
    },
    "access" = "Drupal\Core\Entity\EntityAccessControlHandler",
    "list_builder" = "Drupal\entity_browser\Controllers\EntityBrowserListBuilder",
  },
  links = {
    "canonical" = "/admin/config/content/entity_browser/{entity_browser}",
    "collection" = "/admin/config/content/entity_browser",
    "edit-form" = "/admin/config/content/entity_browser/{entity_browser}/edit",
    "edit-widgets" = "/admin/config/content/entity_browser/{entity_browser}/edit_widgets",
    "delete-form" = "/admin/config/content/entity_browser/{entity_browser}/delete",
  },
  admin_permission = "administer entity browsers",
  config_prefix = "browser",
  entity_keys = {
    "id" = "name",
    "label" = "label"
  },
  config_export = {
    "name",
    "label",
    "display",
    "display_configuration",
    "selection_display",
    "selection_display_configuration",
    "widget_selector",
    "widget_selector_configuration",
    "widgets",
  },
)

Hierarchy

Expanded class hierarchy of EntityBrowser

4 files declare their use of EntityBrowser
ConfigurationTest.php in tests/src/FunctionalJavascript/ConfigurationTest.php
EntityBrowserElement.php in src/Element/EntityBrowserElement.php
EntityReferenceBrowserWidget.php in src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php
FieldWidgetConfigTest.php in tests/src/FunctionalJavascript/FieldWidgetConfigTest.php

File

src/Entity/EntityBrowser.php, line 58

Namespace

Drupal\entity_browser\Entity
View source
class EntityBrowser extends ConfigEntityBase implements EntityBrowserInterface, EntityWithPluginCollectionInterface {

  /**
   * The name of the entity browser.
   *
   * @var string
   */
  public $name;

  /**
   * The entity browser label.
   *
   * @var string
   */
  public $label;

  /**
   * The display plugin id.
   *
   * @var string
   */
  public $display;

  /**
   * The display plugin configuration.
   *
   * @var array
   */
  public $display_configuration = [];

  /**
   * Display lazy plugin collection.
   *
   * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
   */
  protected $displayCollection;

  /**
   * The array of widgets for this entity browser.
   *
   * @var array
   */
  protected $widgets = [];

  /**
   * Holds the collection of widgets that are used by this entity browser.
   *
   * @var \Drupal\entity_browser\WidgetsCollection
   */
  protected $widgetsCollection;

  /**
   * The selection display plugin ID.
   *
   * @var string
   */
  public $selection_display;

  /**
   * The selection display plugin configuration.
   *
   * @var array
   */
  public $selection_display_configuration = [];

  /**
   * Selection display plugin collection.
   *
   * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
   */
  protected $selectionDisplayCollection;

  /**
   * The widget selector plugin ID.
   *
   * @var string
   */
  public $widget_selector;

  /**
   * The widget selector plugin configuration.
   *
   * @var array
   */
  public $widget_selector_configuration = [];

  /**
   * Widget selector plugin collection.
   *
   * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
   */
  protected $widgetSelectorCollection;

  /**
   * Additional widget parameters.
   *
   * @var array
   */
  protected $additional_widget_parameters = [];

  /**
   * Name of the form class.
   *
   * @var string
   */
  protected $form_class = '\\Drupal\\entity_browser\\Form\\EntityBrowserForm';

  /**
   * {@inheritdoc}
   */
  public function id() {
    return $this->name;
  }

  /**
   * {@inheritdoc}
   */
  public function getName() {
    return $this
      ->get('name');
  }

  /**
   * {@inheritdoc}
   */
  public function setName($name) {
    $this->name = $name;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getDisplay() {
    return $this
      ->displayPluginCollection()
      ->get($this->display);
  }

  /**
   * {@inheritdoc}
   */
  public function setLabel($label) {
    $this->label = $label;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setDisplay($display) {
    $this->display = $display;
    $this->displayPluginCollection = NULL;
    $this->display_configuration = [];
    $this
      ->getDisplay();
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setWidgetSelector($widget_selector) {
    $this->widget_selector = $widget_selector;
    $this->widgetSelectorCollection = NULL;
    $this->widget_selector_configuration = [];
    $this
      ->getWidgetSelector();
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setSelectionDisplay($selection_display) {
    $this->selection_display = $selection_display;
    $this->selectionDisplayCollection = NULL;
    $this->selection_display_configuration = [];
    $this
      ->getSelectionDisplay();
    return $this;
  }

  /**
   * Returns display plugin collection.
   *
   * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
   *   The tag plugin collection.
   */
  protected function displayPluginCollection() {
    if (!$this->displayCollection) {
      $this->display_configuration['entity_browser_id'] = $this
        ->id();
      $this->displayCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.entity_browser.display'), $this->display, $this->display_configuration);
    }
    return $this->displayCollection;
  }

  /**
   * Returns the plugin collections used by this entity.
   *
   * @return \Drupal\Component\Plugin\LazyPluginCollection[]
   *   An array of plugin collections, keyed by the property name they use to
   *   store their configuration.
   */
  public function getPluginCollections() {
    return [
      'widgets' => $this
        ->getWidgets(),
      'widget_selector_configuration' => $this
        ->widgetSelectorPluginCollection(),
      'display_configuration' => $this
        ->displayPluginCollection(),
      'selection_display_configuration' => $this
        ->selectionDisplayPluginCollection(),
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getWidget($widget) {
    return $this
      ->getWidgets()
      ->get($widget);
  }

  /**
   * {@inheritdoc}
   */
  public function getWidgets() {
    if (!$this->widgetsCollection) {
      foreach ($this->widgets as &$widget) {
        $widget['settings']['entity_browser_id'] = $this
          ->id();
      }
      $this->widgetsCollection = new WidgetsCollection(\Drupal::service('plugin.manager.entity_browser.widget'), $this->widgets);
      $this->widgetsCollection
        ->sort();
    }
    return $this->widgetsCollection;
  }

  /**
   * {@inheritdoc}
   */
  public function addWidget(array $configuration) {
    $configuration['uuid'] = $this
      ->uuidGenerator()
      ->generate();
    $this
      ->getWidgets()
      ->addInstanceId($configuration['uuid'], $configuration);
    return $configuration['uuid'];
  }

  /**
   * {@inheritdoc}
   */
  public function deleteWidget(WidgetInterface $widget) {
    $this
      ->getWidgets()
      ->removeInstanceId($widget
      ->uuid());
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getFirstWidget() {
    $instance_ids = $this
      ->getWidgets()
      ->getInstanceIds();
    $instance_ids = array_filter($instance_ids, function ($id) {
      return $this
        ->getWidget($id)
        ->access()
        ->isAllowed();
    });
    if (empty($instance_ids)) {
      return NULL;
    }
    return reset($instance_ids);
  }

  /**
   * {@inheritdoc}
   */
  public function addAdditionalWidgetParameters(array $parameters) {

    // TODO - this doesn't make much sense. Refactor.
    $this->additional_widget_parameters += $parameters;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getAdditionalWidgetParameters() {

    // TODO - this doesn't make much sense. Refactor.
    return $this
      ->get('additional_widget_parameters');
  }

  /**
   * Returns selection display plugin collection.
   *
   * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
   *   The tag plugin collection.
   */
  protected function selectionDisplayPluginCollection() {
    if (!$this->selectionDisplayCollection) {
      $this->selection_display_configuration['entity_browser_id'] = $this
        ->id();
      $this->selectionDisplayCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.entity_browser.selection_display'), $this->selection_display, $this->selection_display_configuration);
    }
    return $this->selectionDisplayCollection;
  }

  /**
   * {@inheritdoc}
   */
  public function getSelectionDisplay() {
    return $this
      ->selectionDisplayPluginCollection()
      ->get($this->selection_display);
  }

  /**
   * Returns widget selector plugin collection.
   *
   * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
   *   The tag plugin collection.
   */
  protected function widgetSelectorPluginCollection() {
    if (!$this->widgetSelectorCollection) {
      $options = [];
      foreach ($this
        ->getWidgets()
        ->getInstanceIds() as $id) {
        $options[$id] = $this
          ->getWidgets()
          ->get($id)
          ->label();
      }
      $this->widget_selector_configuration['widget_ids'] = $options;
      $this->widgetSelectorCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.entity_browser.widget_selector'), $this->widget_selector, $this->widget_selector_configuration);
    }
    return $this->widgetSelectorCollection;
  }

  /**
   * {@inheritdoc}
   */
  public function getWidgetSelector() {
    return $this
      ->widgetSelectorPluginCollection()
      ->get($this->widget_selector);
  }

  /**
   * {@inheritdoc}
   */
  public function route() {

    // TODO: Allow displays to define more than just path.
    // See: https://www.drupal.org/node/2364193
    $display = $this
      ->getDisplay();
    if ($display instanceof DisplayRouterInterface) {
      $path = $display
        ->path();
      return new Route($path, [
        '_controller' => 'Drupal\\entity_browser\\Controllers\\EntityBrowserFormController::getContentResult',
        '_title_callback' => 'Drupal\\entity_browser\\Controllers\\EntityBrowserFormController::title',
        'entity_browser_id' => $this
          ->id(),
      ], [
        '_permission' => 'access ' . $this
          ->id() . ' entity browser pages',
      ], [
        '_admin_route' => \Drupal::config('node.settings')
          ->get('use_admin_theme'),
      ]);
    }
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function preSave(EntityStorageInterface $storage) {
    parent::preSave($storage);

    // Entity browser ID was added when creating. No need to save that as it can
    // always be calculated.
    foreach ($this->widgets as &$widget) {
      unset($widget['settings']['entity_browser_id']);
    }
    unset($this->selection_display_configuration['entity_browser_id']);
    unset($this->display_configuration['entity_browser_id']);
    unset($this->widget_selector_configuration['widget_ids']);
  }

  /**
   * Sleep method.
   *
   * Prevents plugin collections from being serialized and correctly serializes
   * selected entities.
   */
  public function __sleep() {

    // Save configuration for all plugins.
    $this->widgets = $this
      ->getWidgets()
      ->getConfiguration();
    $this->widget_selector_configuration = $this
      ->widgetSelectorPluginCollection()
      ->getConfiguration();
    $this->display_configuration = $this
      ->displayPluginCollection()
      ->getConfiguration();
    $this->selection_display_configuration = $this
      ->selectionDisplayPluginCollection()
      ->getConfiguration();
    return array_diff(array_keys(get_object_vars($this)), [
      'widgetsCollection',
      'widgetSelectorCollection',
      'displayCollection',
      'selectionDisplayCollection',
      'selectedEntities',
    ]);
  }

  /**
   * {@inheritdoc}
   */
  public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    parent::postSave($storage, $update);

    // Rebuild route information when browsers that register routes
    // are created/updated.
    \Drupal::service('router.builder')
      ->setRebuildNeeded();
  }

  /**
   * {@inheritdoc}
   */
  public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage, $entities);

    // Rebuild route information when browsers that register routes
    // are deleted.
    \Drupal::service('router.builder')
      ->setRebuildNeeded();
  }

  /**
   * {@inheritdoc}
   */
  public function getFormObject() {
    $form_class = \Drupal::service('class_resolver')
      ->getInstanceFromDefinition($this->form_class);
    $form_class
      ->setEntityBrowser($this);
    return $form_class;
  }

  /**
   * {@inheritdoc}
   */
  protected function urlRouteParameters($rel) {
    $uri_route_parameters = parent::urlRouteParameters($rel);
    if ($rel == 'config-translation-overview') {
      $uri_route_parameters['step'] = 'general';
    }
    return $uri_route_parameters;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
ConfigEntityBase::$isUninstalling private property Whether the config is being deleted by the uninstall process.
ConfigEntityBase::$langcode protected property The language code of the entity's default language.
ConfigEntityBase::$originalId protected property The original ID of the configuration entity.
ConfigEntityBase::$status protected property The enabled/disabled status of the configuration entity. 4
ConfigEntityBase::$third_party_settings protected property Third party entity settings.
ConfigEntityBase::$trustedData protected property Trust supplied data and not use configuration schema on save.
ConfigEntityBase::$uuid protected property The UUID for this entity.
ConfigEntityBase::$_core protected property Information maintained by Drupal core about configuration.
ConfigEntityBase::addDependency protected function Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
ConfigEntityBase::calculateDependencies public function Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityInterface::calculateDependencies 13
ConfigEntityBase::createDuplicate public function Creates a duplicate of the entity. Overrides EntityBase::createDuplicate 1
ConfigEntityBase::disable public function Disables the configuration entity. Overrides ConfigEntityInterface::disable 1
ConfigEntityBase::enable public function Enables the configuration entity. Overrides ConfigEntityInterface::enable
ConfigEntityBase::get public function Returns the value of a property. Overrides ConfigEntityInterface::get
ConfigEntityBase::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. Overrides EntityBase::getCacheTagsToInvalidate 1
ConfigEntityBase::getConfigDependencyName public function Gets the configuration dependency name. Overrides EntityBase::getConfigDependencyName
ConfigEntityBase::getConfigManager protected static function Gets the configuration manager.
ConfigEntityBase::getConfigTarget public function Gets the configuration target identifier for the entity. Overrides EntityBase::getConfigTarget
ConfigEntityBase::getDependencies public function Gets the configuration dependencies. Overrides ConfigEntityInterface::getDependencies
ConfigEntityBase::getOriginalId public function Gets the original ID. Overrides EntityBase::getOriginalId
ConfigEntityBase::getThirdPartyProviders public function Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface::getThirdPartyProviders
ConfigEntityBase::getThirdPartySetting public function Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface::getThirdPartySetting
ConfigEntityBase::getThirdPartySettings public function Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface::getThirdPartySettings
ConfigEntityBase::getTypedConfig protected function Gets the typed config manager.
ConfigEntityBase::hasTrustedData public function Gets whether on not the data is trusted. Overrides ConfigEntityInterface::hasTrustedData
ConfigEntityBase::invalidateTagsOnDelete protected static function Override to never invalidate the individual entities' cache tags; the config system already invalidates them. Overrides EntityBase::invalidateTagsOnDelete
ConfigEntityBase::invalidateTagsOnSave protected function Override to never invalidate the entity's cache tag; the config system already invalidates it. Overrides EntityBase::invalidateTagsOnSave
ConfigEntityBase::isInstallable public function Checks whether this entity is installable. Overrides ConfigEntityInterface::isInstallable 2
ConfigEntityBase::isNew public function Overrides Entity::isNew(). Overrides EntityBase::isNew
ConfigEntityBase::isUninstalling public function Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface::isUninstalling
ConfigEntityBase::link public function Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase::link
ConfigEntityBase::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface::onDependencyRemoval 7
ConfigEntityBase::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase::preDelete 8
ConfigEntityBase::save public function Saves an entity permanently. Overrides EntityBase::save 1
ConfigEntityBase::set public function Sets the value of a property. Overrides ConfigEntityInterface::set
ConfigEntityBase::setOriginalId public function Sets the original ID. Overrides EntityBase::setOriginalId
ConfigEntityBase::setStatus public function Sets the status of the configuration entity. Overrides ConfigEntityInterface::setStatus
ConfigEntityBase::setThirdPartySetting public function Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface::setThirdPartySetting
ConfigEntityBase::setUninstalling public function
ConfigEntityBase::sort public static function Helper callback for uasort() to sort configuration entities by weight and label. 6
ConfigEntityBase::status public function Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface::status 4
ConfigEntityBase::toArray public function Gets an array of all property values. Overrides EntityBase::toArray 2
ConfigEntityBase::toUrl public function Gets the URL object for the entity. Overrides EntityBase::toUrl
ConfigEntityBase::trustData public function Sets that the data should be trusted. Overrides ConfigEntityInterface::trustData
ConfigEntityBase::unsetThirdPartySetting public function Unsets a third-party setting. Overrides ThirdPartySettingsInterface::unsetThirdPartySetting
ConfigEntityBase::url public function Gets the public URL for this entity. Overrides EntityBase::url
ConfigEntityBase::urlInfo public function Gets the URL object for the entity. Overrides EntityBase::urlInfo
ConfigEntityBase::__construct public function Constructs an Entity object. Overrides EntityBase::__construct 10
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function Aliased as: traitSleep 1
DependencySerializationTrait::__wakeup public function 2
DependencyTrait::$dependencies protected property The object's dependencies.
DependencyTrait::addDependencies protected function Adds multiple dependencies.
DependencyTrait::addDependency protected function Adds a dependency. Aliased as: addDependencyTrait
EntityBase::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
EntityBase::$entityTypeId protected property The entity type.
EntityBase::$typedData protected property A typed data object wrapping this entity.
EntityBase::access public function Checks data value access. Overrides AccessibleInterface::access 1
EntityBase::bundle public function Gets the bundle of the entity. Overrides EntityInterface::bundle 1
EntityBase::create public static function Constructs a new entity object, without permanently saving it. Overrides EntityInterface::create
EntityBase::delete public function Deletes an entity permanently. Overrides EntityInterface::delete 2
EntityBase::enforceIsNew public function Enforces an entity to be new. Overrides EntityInterface::enforceIsNew
EntityBase::entityManager Deprecated protected function Gets the entity manager.
EntityBase::entityTypeBundleInfo protected function Gets the entity type bundle info service.
EntityBase::entityTypeManager protected function Gets the entity type manager.
EntityBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyTrait::getCacheContexts
EntityBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyTrait::getCacheMaxAge
EntityBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyTrait::getCacheTags
EntityBase::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. Overrides EntityInterface::getConfigDependencyKey
EntityBase::getEntityType public function Gets the entity type definition. Overrides EntityInterface::getEntityType
EntityBase::getEntityTypeId public function Gets the ID of the type of the entity. Overrides EntityInterface::getEntityTypeId
EntityBase::getListCacheTagsToInvalidate protected function The list cache tags to invalidate for this entity.
EntityBase::getTypedData public function Gets a typed data object for this entity object. Overrides EntityInterface::getTypedData
EntityBase::hasLinkTemplate public function Indicates if a link template exists for a given key. Overrides EntityInterface::hasLinkTemplate
EntityBase::label public function Gets the label of the entity. Overrides EntityInterface::label 6
EntityBase::language public function Gets the language of the entity. Overrides EntityInterface::language 1
EntityBase::languageManager protected function Gets the language manager.
EntityBase::linkTemplates protected function Gets an array link templates. 1
EntityBase::load public static function Loads an entity. Overrides EntityInterface::load
EntityBase::loadMultiple public static function Loads one or more entities. Overrides EntityInterface::loadMultiple
EntityBase::postCreate public function Acts on a created entity before hooks are invoked. Overrides EntityInterface::postCreate 4
EntityBase::postLoad public static function Acts on loaded entities. Overrides EntityInterface::postLoad 2
EntityBase::preCreate public static function Changes the values of an entity before it is created. Overrides EntityInterface::preCreate 5
EntityBase::referencedEntities public function Gets a list of entities referenced by this entity. Overrides EntityInterface::referencedEntities 1
EntityBase::toLink public function Generates the HTML for a link to this entity. Overrides EntityInterface::toLink
EntityBase::uriRelationships public function Gets a list of URI relationships supported by this entity. Overrides EntityInterface::uriRelationships
EntityBase::uuid public function Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface::uuid 1
EntityBase::uuidGenerator protected function Gets the UUID generator.
EntityBrowser::$additional_widget_parameters protected property Additional widget parameters.
EntityBrowser::$display public property The display plugin id.
EntityBrowser::$displayCollection protected property Display lazy plugin collection.
EntityBrowser::$display_configuration public property The display plugin configuration.
EntityBrowser::$form_class protected property Name of the form class.
EntityBrowser::$label public property The entity browser label.
EntityBrowser::$name public property The name of the entity browser.
EntityBrowser::$selectionDisplayCollection protected property Selection display plugin collection.
EntityBrowser::$selection_display public property The selection display plugin ID.
EntityBrowser::$selection_display_configuration public property The selection display plugin configuration.
EntityBrowser::$widgets protected property The array of widgets for this entity browser.
EntityBrowser::$widgetsCollection protected property Holds the collection of widgets that are used by this entity browser.
EntityBrowser::$widgetSelectorCollection protected property Widget selector plugin collection.
EntityBrowser::$widget_selector public property The widget selector plugin ID.
EntityBrowser::$widget_selector_configuration public property The widget selector plugin configuration.
EntityBrowser::addAdditionalWidgetParameters public function Adds paramterers that will be passed to the widget. Overrides EntityBrowserInterface::addAdditionalWidgetParameters
EntityBrowser::addWidget public function Saves a widget for this entity browser. Overrides EntityBrowserInterface::addWidget
EntityBrowser::deleteWidget public function Deletes a widget from this entity browser. Overrides EntityBrowserInterface::deleteWidget
EntityBrowser::displayPluginCollection protected function Returns display plugin collection.
EntityBrowser::getAdditionalWidgetParameters public function Gets additional parameters that will be passed to the widget. Overrides EntityBrowserInterface::getAdditionalWidgetParameters
EntityBrowser::getDisplay public function Returns the display. Overrides EntityBrowserInterface::getDisplay
EntityBrowser::getFirstWidget public function Gets first widget based on weights. Overrides EntityBrowserInterface::getFirstWidget
EntityBrowser::getFormObject public function Gets entity browser form object. Overrides EntityBrowserInterface::getFormObject
EntityBrowser::getName public function Gets the entity browser name. Overrides EntityBrowserInterface::getName
EntityBrowser::getPluginCollections public function Returns the plugin collections used by this entity. Overrides ObjectWithPluginCollectionInterface::getPluginCollections
EntityBrowser::getSelectionDisplay public function Returns the selection display. Overrides EntityBrowserInterface::getSelectionDisplay
EntityBrowser::getWidget public function Returns a specific widget. Overrides EntityBrowserInterface::getWidget
EntityBrowser::getWidgets public function Returns the widgets for this entity browser. Overrides EntityBrowserInterface::getWidgets
EntityBrowser::getWidgetSelector public function Returns the widget selector. Overrides EntityBrowserInterface::getWidgetSelector
EntityBrowser::id public function Gets the identifier. Overrides EntityBase::id
EntityBrowser::postDelete public static function Acts on deleted entities before the delete hook is invoked. Overrides EntityBase::postDelete
EntityBrowser::postSave public function Acts on a saved entity before the insert or update hook is invoked. Overrides EntityBase::postSave
EntityBrowser::preSave public function Acts on an entity before the presave hook is invoked. Overrides ConfigEntityBase::preSave
EntityBrowser::route public function Gets route that matches this display. Overrides EntityBrowserInterface::route
EntityBrowser::selectionDisplayPluginCollection protected function Returns selection display plugin collection.
EntityBrowser::setDisplay public function Sets the id of the display plugin. Overrides EntityBrowserInterface::setDisplay
EntityBrowser::setLabel public function Sets the label of the entity browser. Overrides EntityBrowserInterface::setLabel
EntityBrowser::setName public function Sets the name of the entity browser. Overrides EntityBrowserInterface::setName
EntityBrowser::setSelectionDisplay public function Sets the id of the selection display plugin. Overrides EntityBrowserInterface::setSelectionDisplay
EntityBrowser::setWidgetSelector public function Sets the id of the widget selector plugin. Overrides EntityBrowserInterface::setWidgetSelector
EntityBrowser::urlRouteParameters protected function Gets an array of placeholders for this entity. Overrides EntityBase::urlRouteParameters
EntityBrowser::widgetSelectorPluginCollection protected function Returns widget selector plugin collection.
EntityBrowser::__sleep public function Sleep method. Overrides ConfigEntityBase::__sleep
PluginDependencyTrait::calculatePluginDependencies protected function Calculates and adds dependencies of a specific plugin instance. 1
PluginDependencyTrait::getPluginDependencies protected function Calculates and returns dependencies of a specific plugin instance.
PluginDependencyTrait::moduleHandler protected function Wraps the module handler. 1
PluginDependencyTrait::themeHandler protected function Wraps the theme handler. 1
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
SynchronizableEntityTrait::$isSyncing protected property Whether this entity is being created, updated or deleted through a synchronization process.
SynchronizableEntityTrait::isSyncing public function
SynchronizableEntityTrait::setSyncing public function