public function EntityManager::getDefinitions

Overrides Drupal\Component\Plugin\PluginManagerBase::getDefinitions().

Overrides PluginManagerBase::getDefinitions

1 call to EntityManager::getDefinitions()

File

drupal/core/lib/Drupal/Core/Entity/EntityManager.php, line 255
Contains \Drupal\Core\Entity\EntityManager.

Class

EntityManager
Manages entity type plugin definitions.

Namespace

Drupal\Core\Entity

Code

public function getDefinitions() {

  // Because \Drupal\Core\Plugin\Discovery\CacheDecorator runs before
  // definitions are processed and does not support cache tags, we perform our
  // own caching.
  if ($cache = cache($this->cacheBin)
    ->get($this->cacheKey)) {
    return $cache->data;
  }
  else {

    // @todo Remove array_filter() once http://drupal.org/node/1780396 is
    //   resolved.
    $definitions = array_filter(parent::getDefinitions());
    cache($this->cacheBin)
      ->set($this->cacheKey, $definitions, $this->cacheExpire, $this->cacheTags);
    return $definitions;
  }
}