You are here

public function EntityBrowserEnhancedPluginManager::processDefinition in Entity Browser Enhance(d|r) 8

Performs extra processing on plugin definitions.

By default we add defaults for the type to the definition. If a type has additional processing logic they can do that by replacing or extending the method.

Overrides DefaultPluginManager::processDefinition

File

src/EntityBrowserEnhancedPluginManager.php, line 60

Class

EntityBrowserEnhancedPluginManager
Provides the default entity_browser_enhanced_plugin manager.

Namespace

Drupal\entity_browser_enhanced

Code

public function processDefinition(&$definition, $plugin_id) {
  parent::processDefinition($definition, $plugin_id);
  if (empty($definition['id'])) {
    throw new PluginException(sprintf('Enhancer ID property (%s) definition "is" is required.', $plugin_id));
  }
  if (empty($definition['label'])) {
    throw new PluginException(sprintf('Enhancer Lable property (%s) definition "is" is required.', $plugin_id));
  }
  if (empty($definition['form_extra_class'])) {
    throw new PluginException(sprintf('Enhancer form extra CSS class selector property (%s) definition "is" is required.', $plugin_id));
  }
  if (empty($definition['libraray'])) {
    throw new PluginException(sprintf('Enhancer libraray (in a module or theme) property (%s) definition "is" is required.', $plugin_id));
  }
}