protected function EntityTypeManager::findDefinitions

protected EntityTypeManager::findDefinitions()

Finds plugin definitions.

Return value

array List of definitions to store in cache.

Overrides DefaultPluginManager::findDefinitions

File

core/lib/Drupal/Core/Entity/EntityTypeManager.php, line 97

Class

EntityTypeManager
Manages entity type plugin definitions.

Namespace

Drupal\Core\Entity

Code

protected function findDefinitions() {
  $definitions = $this->getDiscovery()->getDefinitions();

  // Directly call the hook implementations to pass the definitions to them
  // by reference, so new entity types can be added.
  foreach ($this->moduleHandler->getImplementations('entity_type_build') as $module) {
    $function = $module . '_' . 'entity_type_build';
    $function($definitions);
  }
  foreach ($definitions as $plugin_id => $definition) {
    $this->processDefinition($definition, $plugin_id);
  }
  $this->alterDefinitions($definitions);

  return $definitions;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityTypeManager.php/function/EntityTypeManager::findDefinitions/8.1.x