diff --git a/core/includes/entity.api.php b/core/includes/entity.api.php index 193fbe2..24d2b51 100644 --- a/core/includes/entity.api.php +++ b/core/includes/entity.api.php @@ -15,7 +15,7 @@ * * Modules may implement this hook to alter the information that defines an * entity. All properties that are available in - * Drupal\Core\Plugin\Type\EntityManager can be altered here. + * \Drupal\Core\Entity\EntityManager can be altered here. * * In addition, the following properties should be added here: * - bundles: An array describing all bundles for this object type. Keys are @@ -67,7 +67,7 @@ * type name. * * @see \Drupal\Core\Entity\Entity - * @see Drupal\Core\Plugin\Type\EntityManager + * @see \Drupal\Core\Entity\EntityManager * @see entity_get_info() * * @todo Allow a module to add its bundles and view modes before other modules diff --git a/core/includes/entity.inc b/core/includes/entity.inc index 87d7424..d221d4a 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -21,11 +21,10 @@ * * @return array * An array containing the entity type's definition, as retrieved with - * \Drupal\Core\Plugin\Type\EntityManager. If $entity_type is NULL, an - * associative array of all entity type definitions keyed by entity type is - * returned. + * \Drupal\Core\Entity\EntityManager. If $entity_type is NULL, an associative + * array of all entity type definitions keyed by entity type is returned. * - * @see \Drupal\Core\Plugin\Type\EntityManager + * @see \Drupal\Core\Entity\EntityManager * @see hook_entity_info_alter() */ function entity_get_info($entity_type = NULL) { @@ -70,7 +69,7 @@ function entity_info_cache_clear() { * @return Drupal\Core\Entity\EntityInterface * The entity object, or FALSE if there is no entity with the given id. * - * @see Drupal\Core\Plugin\Type\EntityManager + * @see \Drupal\Core\Entity\EntityManager * @see entity_load_multiple() * @see Drupal\Core\Entity\EntityStorageControllerInterface * @see Drupal\Core\Entity\DatabaseStorageController @@ -93,7 +92,7 @@ function entity_load($entity_type, $id, $reset = FALSE) { * The entity object, or FALSE if there is no entity with the given revision * id. * - * @see Drupal\Core\Plugin\Type\EntityManager + * @see \Drupal\Core\Entity\EntityManager * @see Drupal\Core\Entity\EntityStorageControllerInterface * @see Drupal\Core\Entity\DatabaseStorageController */ @@ -131,7 +130,7 @@ function entity_revision_delete($entity_type, $revision_id) { * @throws Drupal\Core\Entity\EntityStorageException * Thrown in case the requested entity type does not support UUIDs. * - * @see Drupal\Core\Plugin\Type\EntityManager + * @see \Drupal\Core\Entity\EntityManager */ function entity_load_by_uuid($entity_type, $uuid, $reset = FALSE) { $entity_info = entity_get_info($entity_type); @@ -176,7 +175,7 @@ function entity_load_by_uuid($entity_type, $uuid, $reset = FALSE) { * @return array * An array of entity objects indexed by their ids. * - * @see Drupal\Core\Plugin\Type\EntityManager + * @see \Drupal\Core\Entity\EntityManager * @see Drupal\Core\Entity\EntityStorageControllerInterface * @see Drupal\Core\Entity\DatabaseStorageController * @see Drupal\Core\Entity\EntityFieldQuery @@ -300,7 +299,7 @@ function entity_page_label(EntityInterface $entity, $langcode = NULL) { * used. If a non-existing non-default operation is specified an exception will * be thrown. * - * @see Drupal\Core\Plugin\Type\EntityManager + * @see \Drupal\Core\Entity\EntityManager * * @param $entity_type * The type of the entity. @@ -466,7 +465,7 @@ function entity_form_submit_build_entity($entity_type, $entity, $form, &$form_st * @return Drupal\Core\Entity\EntityListControllerInterface * An entity list controller. * - * @see Drupal\Core\Plugin\Type\EntityManager + * @see \Drupal\Core\Entity\EntityManager */ function entity_list_controller($entity_type) { $storage = entity_get_controller($entity_type); @@ -484,7 +483,7 @@ function entity_list_controller($entity_type) { * @return Drupal\Core\Entity\EntityRenderControllerInterface * An entity render controller. * - * @see Drupal\Core\Plugin\Type\EntityManager + * @see \Drupal\Core\Entity\EntityManager */ function entity_render_controller($entity_type) { $info = entity_get_info($entity_type); diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php index 5d67873..f6439c9 100644 --- a/core/lib/Drupal/Core/CoreBundle.php +++ b/core/lib/Drupal/Core/CoreBundle.php @@ -69,7 +69,7 @@ public function build(ContainerBuilder $container) { $container->register('router.builder', 'Drupal\Core\Routing\RouteBuilder') ->addArgument(new Reference('router.dumper')); - $container->register('plugin.manager.entity', 'Drupal\Core\Plugin\Type\EntityManager'); + $container->register('plugin.manager.entity', 'Drupal\Core\Entity\EntityManager'); $container->register('matcher', 'Drupal\Core\Routing\ChainMatcher'); $container->register('legacy_url_matcher', 'Drupal\Core\LegacyUrlMatcher') diff --git a/core/lib/Drupal/Core/Plugin/Type/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php similarity index 97% rename from core/lib/Drupal/Core/Plugin/Type/EntityManager.php rename to core/lib/Drupal/Core/Entity/EntityManager.php index cdc8ac8..57a9e0f 100644 --- a/core/lib/Drupal/Core/Plugin/Type/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\Core\Plugin\Type\EntityManager. + * Contains \Drupal\Core\Entity\EntityManager. */ -namespace Drupal\Core\Plugin\Type; +namespace Drupal\Core\Entity; use Drupal\Component\Plugin\PluginManagerBase; use Drupal\Component\Plugin\Factory\DefaultFactory; @@ -99,7 +99,7 @@ * object. * * The defaults for the plugin definition are provided in - * \Drupal\Core\Plugin\Type\EntityManager::definition. + * \Drupal\Core\Entity\EntityManager::defaults. * * Additional keys may be added to the entity definition with * hook_entity_info_alter(). In particular, lists of the entity type's bundles @@ -195,6 +195,9 @@ public function getDefinition($plugin_id) { * Overrides Drupal\Component\Plugin\PluginManagerBase::getDefinitions(). */ 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; } diff --git a/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php b/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php index 6fbe216..353ed1d 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php @@ -11,7 +11,7 @@ * Defines a common interface for entity controller classes. * * All entity controller classes specified via the 'controller_class' key - * returned by Drupal\Core\Plugin\Type\EntityManager or hook_entity_info_alter() + * returned by \Drupal\Core\Entity\EntityManager or hook_entity_info_alter() * have to implement this interface. * * Most simple, SQL-based entity controllers will do better by extending