You are here

public function EntityBrowser::getWidgets in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/Entity/EntityBrowser.php \Drupal\entity_browser\Entity\EntityBrowser::getWidgets()

Returns the widgets for this entity browser.

Return value

\Drupal\entity_browser\WidgetsLazyPluginCollection The tag plugin bag.

Overrides EntityBrowserInterface::getWidgets

1 call to EntityBrowser::getWidgets()
EntityBrowser::getPluginCollections in src/Entity/EntityBrowser.php
Returns the plugin collections used by this entity.

File

src/Entity/EntityBrowser.php, line 275

Class

EntityBrowser
Defines an entity browser configuration entity.

Namespace

Drupal\entity_browser\Entity

Code

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;
}