diff --git a/core/includes/entity.inc b/core/includes/entity.inc index 2859b59..2c9846c 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -70,11 +70,11 @@ function entity_get_bundles($entity_type = NULL) { function entity_invoke_bundle_hook($hook, $entity_type, $bundle, $bundle_new = NULL) { entity_info_cache_clear(); - // Notify the entity storage controller. + // Notify the entity storage. $method = 'onBundle' . ucfirst($hook); - $storage_controller = \Drupal::entityManager()->getStorageController($entity_type); - if (method_exists($storage_controller, $method)) { - $storage_controller->$method($bundle, $bundle_new); + $storage = \Drupal::entityManager()->getStorage($entity_type); + if (method_exists($storage, $method)) { + $storage->$method($bundle, $bundle_new); } // Invoke hook_entity_bundle_*() hooks. \Drupal::moduleHandler()->invokeAll('entity_bundle_' . $hook, array($entity_type, $bundle, $bundle_new)); @@ -170,12 +170,12 @@ function entity_get_view_modes($entity_type = NULL) { * The entity object, or NULL if there is no entity with the given id. * * @see \Drupal\Core\Entity\EntityManagerInterface - * @see \Drupal\Core\Entity\EntityStorageControllerInterface - * @see \Drupal\Core\Entity\DatabaseStorageController + * @see \Drupal\Core\Entity\EntityStorageInterface + * @see \Drupal\Core\Entity\DatabaseEntityStorage * @see \Drupal\Core\Entity\Query\QueryInterface */ function entity_load($entity_type, $id, $reset = FALSE) { - $controller = \Drupal::entityManager()->getStorageController($entity_type); + $controller = \Drupal::entityManager()->getStorage($entity_type); if ($reset) { $controller->resetCache(array($id)); } @@ -195,12 +195,12 @@ function entity_load($entity_type, $id, $reset = FALSE) { * id. * * @see \Drupal\Core\Entity\EntityManagerInterface - * @see \Drupal\Core\Entity\EntityStorageControllerInterface - * @see \Drupal\Core\Entity\DatabaseStorageController + * @see \Drupal\Core\Entity\EntityStorageInterface + * @see \Drupal\Core\Entity\DatabaseEntityStorage */ function entity_revision_load($entity_type, $revision_id) { return \Drupal::entityManager() - ->getStorageController($entity_type) + ->getStorage($entity_type) ->loadRevision($revision_id); } @@ -214,7 +214,7 @@ function entity_revision_load($entity_type, $revision_id) { */ function entity_revision_delete($entity_type, $revision_id) { \Drupal::entityManager() - ->getStorageController($entity_type) + ->getStorage($entity_type) ->deleteRevision($revision_id); } @@ -245,7 +245,7 @@ function entity_load_by_uuid($entity_type_id, $uuid, $reset = FALSE) { throw new EntityStorageException("Entity type $entity_type_id does not support UUIDs."); } - $controller = \Drupal::entityManager()->getStorageController($entity_type_id); + $controller = \Drupal::entityManager()->getStorage($entity_type_id); if ($reset) { $controller->resetCache(); } @@ -261,14 +261,14 @@ function entity_load_by_uuid($entity_type_id, $uuid, $reset = FALSE) { * database access if loaded again during the same page request. * * The actual loading is done through a class that has to implement the - * Drupal\Core\Entity\EntityStorageControllerInterface interface. By default, - * Drupal\Core\Entity\DatabaseStorageController is used. Entity types can + * Drupal\Core\Entity\EntityStorageInterface interface. By default, + * Drupal\Core\Entity\DatabaseEntityStorage is used. Entity types can * specify that a different class should be used by setting the * "controllers['storage']" key in the entity plugin annotation. These classes - * can either implement the Drupal\Core\Entity\EntityStorageControllerInterface + * can either implement the Drupal\Core\Entity\EntityStorageInterface * interface, or, most commonly, extend the - * Drupal\Core\Entity\DatabaseStorageController class. - * See Drupal\node\Entity\Node and Drupal\node\NodeStorageController + * Drupal\Core\Entity\DatabaseEntityStorage class. + * See Drupal\node\Entity\Node and Drupal\node\NodeStorage * for an example. * * @param string $entity_type @@ -282,12 +282,12 @@ function entity_load_by_uuid($entity_type_id, $uuid, $reset = FALSE) { * An array of entity objects indexed by their ids. * * @see \Drupal\Core\Entity\EntityManagerInterface - * @see \Drupal\Core\Entity\EntityStorageControllerInterface - * @see \Drupal\Core\Entity\DatabaseStorageController + * @see \Drupal\Core\Entity\EntityStorageInterface + * @see \Drupal\Core\Entity\DatabaseEntityStorage * @see \Drupal\Core\Entity\Query\QueryInterface */ function entity_load_multiple($entity_type, array $ids = NULL, $reset = FALSE) { - $controller = \Drupal::entityManager()->getStorageController($entity_type); + $controller = \Drupal::entityManager()->getStorage($entity_type); if ($reset) { $controller->resetCache($ids); } @@ -308,7 +308,7 @@ function entity_load_multiple($entity_type, array $ids = NULL, $reset = FALSE) { */ function entity_load_multiple_by_properties($entity_type, array $values) { return \Drupal::entityManager() - ->getStorageController($entity_type) + ->getStorage($entity_type) ->loadByProperties($values); } @@ -330,7 +330,7 @@ function entity_load_multiple_by_properties($entity_type, array $values) { */ function entity_load_unchanged($entity_type, $id) { return \Drupal::entityManager() - ->getStorageController($entity_type) + ->getStorage($entity_type) ->loadUnchanged($id); } @@ -343,7 +343,7 @@ function entity_load_unchanged($entity_type, $id) { * An array of entity IDs of the entities to delete. */ function entity_delete_multiple($entity_type, array $ids) { - $controller = \Drupal::entityManager()->getStorageController($entity_type); + $controller = \Drupal::entityManager()->getStorage($entity_type); $entities = $controller->loadMultiple($ids); $controller->delete($entities); } @@ -362,23 +362,23 @@ function entity_delete_multiple($entity_type, array $ids) { */ function entity_create($entity_type, array $values = array()) { return \Drupal::entityManager() - ->getStorageController($entity_type) + ->getStorage($entity_type) ->create($values); } /** * Gets the entity controller class for an entity type. * - * @return \Drupal\Core\Entity\EntityStorageControllerInterface + * @return \Drupal\Core\Entity\EntityStorageInterface * - * @see \Drupal\Core\Entity\EntityManagerInterface::getStorageController(). + * @see \Drupal\Core\Entity\EntityManagerInterface::getStorage() * * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. - * Use \Drupal::entityManager()->getStorageController(). + * Use \Drupal::entityManager()->getStorage(). */ function entity_get_controller($entity_type) { return \Drupal::entityManager() - ->getStorageController($entity_type); + ->getStorage($entity_type); } /** diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 3533c85..3d14050 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -211,7 +211,7 @@ /** * The maximum depth of a menu links tree - matches the number of p columns. * - * @todo Move this constant to MenuLinkStorageController along with all the tree + * @todo Move this constant to MenuLinkStorage along with all the tree * functionality. */ const MENU_MAX_DEPTH = 9; @@ -1547,7 +1547,7 @@ function menu_cache_clear_all() { */ function menu_reset_static_cache() { \Drupal::entityManager() - ->getStorageController('menu_link')->resetCache(); + ->getStorage('menu_link')->resetCache(); drupal_static_reset('_menu_build_tree'); drupal_static_reset('menu_tree'); drupal_static_reset('menu_tree_all_data'); @@ -1611,9 +1611,9 @@ function menu_link_rebuild_defaults() { // when possible. return; } - /** @var \Drupal\menu_link\MenuLinkStorageControllerInterface $menu_link_storage */ + /** @var \Drupal\menu_link\MenuLinkStorageInterface $menu_link_storage */ $menu_link_storage = \Drupal::entityManager() - ->getStorageController('menu_link'); + ->getStorage('menu_link'); $links = array(); $children = array(); $top_links = array(); diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php index 090b883..8c1908c 100644 --- a/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -9,7 +9,7 @@ use Drupal\Component\Utility\String; use Drupal\Core\Config\ConfigEvents; -use Drupal\Core\Config\Entity\ConfigStorageControllerInterface; +use Drupal\Core\Config\Entity\ConfigEntityStorageInterface; use Drupal\Core\Config\Entity\ImportableEntityStorageInterface; use Drupal\Core\DependencyInjection\DependencySerialization; use Drupal\Core\Entity\EntityStorageException; @@ -283,7 +283,7 @@ protected function importConfig($op, $name) { } /** - * Invokes import* methods on configuration entity storage controllers. + * Invokes import* methods on configuration entity storages. * * Allow modules to take over configuration change operations for higher-level * configuration data. @@ -320,9 +320,9 @@ protected function importInvokeOwner($op, $name) { } $method = 'import' . ucfirst($op); - $entity_storage = $this->configManager->getEntityManager()->getStorageController($entity_type); - // Call to the configuration entity's storage controller to handle the - // configuration change. + $entity_storage = $this->configManager->getEntityManager()->getStorage($entity_type); + // Call to the configuration entity's storage to handle the configuration + // change. if (!($entity_storage instanceof ImportableEntityStorageInterface)) { throw new EntityStorageException(String::format('The entity storage "@storage" for the "@entity_type" entity type does not support imports', array('@storage' => get_class($entity_storage), '@entity_type' => $entity_type))); } diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index b039b8f..3769a7b 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -127,7 +127,7 @@ public function installDefaultConfig($type, $name) { if ($entity_type = $this->configManager->getEntityTypeIdByName($name)) { $entity_storage = $this->configManager ->getEntityManager() - ->getStorageController($entity_type); + ->getStorage($entity_type); // It is possible that secondary writes can occur during configuration // creation. Updates of such configuration are allowed. if ($this->activeStorage->exists($name)) { diff --git a/core/lib/Drupal/Core/Config/ConfigManager.php b/core/lib/Drupal/Core/Config/ConfigManager.php index 418b912..d1048ea 100644 --- a/core/lib/Drupal/Core/Config/ConfigManager.php +++ b/core/lib/Drupal/Core/Config/ConfigManager.php @@ -188,7 +188,7 @@ public function findConfigEntityDependentsAsEntities($type, array $names) { $definitions = $this->entityManager->getDefinitions(); foreach ($dependencies as $config_name => $dependency) { // Group by entity type to efficient load entities using - // \Drupal\Core\Entity\EntityStorageControllerInterface::loadMultiple(). + // \Drupal\Core\Entity\EntityStorageInterface::loadMultiple(). $entity_type_id = $this->getEntityTypeIdByName($config_name); // It is possible that a non-configuration entity will be returned if a // simple configuration object has a UUID key. This would occur if the @@ -201,10 +201,10 @@ public function findConfigEntityDependentsAsEntities($type, array $names) { } $entities_to_return = array(); foreach ($entities as $entity_type_id => $entities_to_load) { - $storage_controller = $this->entityManager->getStorageController($entity_type_id); + $storage = $this->entityManager->getStorage($entity_type_id); // Remove the keys since there are potential ID clashes from different // configuration entity types. - $entities_to_return = array_merge($entities_to_return, array_values($storage_controller->loadMultiple($entities_to_load))); + $entities_to_return = array_merge($entities_to_return, array_values($storage->loadMultiple($entities_to_load))); } return $entities_to_return; } diff --git a/core/lib/Drupal/Core/Config/DatabaseStorage.php b/core/lib/Drupal/Core/Config/DatabaseStorage.php index c43145a..fd8f2ee 100644 --- a/core/lib/Drupal/Core/Config/DatabaseStorage.php +++ b/core/lib/Drupal/Core/Config/DatabaseStorage.php @@ -11,7 +11,7 @@ use Drupal\Core\Database\Connection; /** - * Defines the Database storage controller. + * Defines the Database storage. */ class DatabaseStorage implements StorageInterface { diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 492876a..b05251f 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -10,7 +10,7 @@ use Drupal\Component\Utility\String; use Drupal\Core\Entity\Entity; use Drupal\Core\Config\ConfigDuplicateUUIDException; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines a base configuration entity class. @@ -248,8 +248,8 @@ public function toArray() { /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { - parent::preSave($storage_controller); + public function preSave(EntityStorageInterface $storage) { + parent::preSave($storage); // @todo When \Drupal\Core\Config\Entity\EntityWithPluginBagInterface moves // to a trait, switch to class_uses() instead. @@ -262,7 +262,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { // Ensure this entity's UUID does not exist with a different ID, regardless // of whether it's new or updated. - $matching_entities = $storage_controller->getQuery() + $matching_entities = $storage->getQuery() ->condition('uuid', $this->uuid()) ->execute(); $matched_entity = reset($matching_entities); @@ -271,7 +271,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { } if (!$this->isNew()) { - $original = $storage_controller->loadUnchanged($this->id()); + $original = $storage->loadUnchanged($this->id()); // Ensure that the UUID cannot be changed for an existing entity. if ($original && ($original->uuid() != $this->uuid())) { throw new ConfigDuplicateUUIDException(String::format('Attempt to save a configuration entity %id with UUID %uuid when this entity already exists with UUID %original_uuid', array('%id' => $this->id(), '%uuid' => $this->uuid(), '%original_uuid' => $original->uuid()))); diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php similarity index 92% rename from core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php rename to core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php index 730aaa2..4656897 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\Core\Config\Entity\ConfigStorageController. + * Definition of Drupal\Core\Config\Entity\ConfigEntityStorage. */ namespace Drupal\Core\Config\Entity; @@ -11,7 +11,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityMalformedException; -use Drupal\Core\Entity\EntityStorageControllerBase; +use Drupal\Core\Entity\EntityStorageBase; use Drupal\Core\Config\Config; use Drupal\Core\Config\StorageInterface; use Drupal\Core\Entity\EntityTypeInterface; @@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Defines the storage controller class for configuration entities. + * Defines the storage class for configuration entities. * * Configuration object names of configuration entities are comprised of two * parts, separated by a dot: @@ -35,7 +35,7 @@ * after the config_prefix in a config name forms the entity ID. Additional or * custom suffixes are not possible. */ -class ConfigStorageController extends EntityStorageControllerBase implements ConfigStorageControllerInterface, ImportableEntityStorageInterface { +class ConfigEntityStorage extends EntityStorageBase implements ConfigEntityStorageInterface, ImportableEntityStorageInterface { /** * The UUID service. @@ -66,7 +66,7 @@ class ConfigStorageController extends EntityStorageControllerBase implements Con protected $configStorage; /** - * Constructs a ConfigStorageController object. + * Constructs a ConfigEntityStorage object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -148,14 +148,14 @@ public function load($id) { } /** - * Implements Drupal\Core\Entity\EntityStorageControllerInterface::loadRevision(). + * Implements Drupal\Core\Entity\EntityStorageInterface::loadRevision(). */ public function loadRevision($revision_id) { return FALSE; } /** - * Implements Drupal\Core\Entity\EntityStorageControllerInterface::deleteRevision(). + * Implements Drupal\Core\Entity\EntityStorageInterface::deleteRevision(). */ public function deleteRevision($revision_id) { return NULL; @@ -184,8 +184,8 @@ public static function getIDFromConfigName($config_name, $config_prefix) { * being loaded needs to be augmented with additional data from another * table, such as loading node type into comments or vocabulary machine name * into terms, however it can also support $conditions on different tables. - * See Drupal\comment\CommentStorageController::buildQuery() or - * Drupal\taxonomy\TermStorageController::buildQuery() for examples. + * See Drupal\comment\CommentStorage::buildQuery() or + * Drupal\taxonomy\TermStorage::buildQuery() for examples. * * @param $ids * An array of entity IDs, or NULL to load all entities. @@ -221,7 +221,7 @@ protected function buildQuery($ids, $revision_id = FALSE) { } /** - * Implements Drupal\Core\Entity\EntityStorageControllerInterface::create(). + * Implements Drupal\Core\Entity\EntityStorageInterface::create(). */ public function create(array $values = array()) { $class = $this->entityType->getClass(); @@ -254,7 +254,7 @@ public function create(array $values = array()) { } /** - * Implements Drupal\Core\Entity\EntityStorageControllerInterface::delete(). + * Implements Drupal\Core\Entity\EntityStorageInterface::delete(). */ public function delete(array $entities) { if (!$entities) { @@ -280,7 +280,7 @@ public function delete(array $entities) { } /** - * Implements Drupal\Core\Entity\EntityStorageControllerInterface::save(). + * Implements Drupal\Core\Entity\EntityStorageInterface::save(). * * @throws EntityMalformedException * When attempting to save a configuration entity that has no ID. @@ -369,7 +369,7 @@ protected function invokeHook($hook, EntityInterface $entity) { } /** - * Implements Drupal\Core\Entity\EntityStorageControllerInterface::getQueryServicename(). + * Implements Drupal\Core\Entity\EntityStorageInterface::getQueryServicename(). */ public function getQueryServicename() { return 'entity.query.config'; diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageControllerInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorageInterface.php similarity index 79% rename from core/lib/Drupal/Core/Config/Entity/ConfigStorageControllerInterface.php rename to core/lib/Drupal/Core/Config/Entity/ConfigEntityStorageInterface.php index e479b7f..5efa615 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageControllerInterface.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorageInterface.php @@ -2,18 +2,18 @@ /** * @file - * Contains \Drupal\Core\Config\Entity\ConfigStorageControllerInterface. + * Contains \Drupal\Core\Config\Entity\ConfigEntityStorageInterface. */ namespace Drupal\Core\Config\Entity; use Drupal\Core\Config\Config; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Provides an interface for configuration entity storage. */ -interface ConfigStorageControllerInterface extends EntityStorageControllerInterface { +interface ConfigEntityStorageInterface extends EntityStorageInterface { /** * Returns the config prefix used by the configuration entity type. diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php index 9a61693..061c2e7 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php @@ -26,7 +26,7 @@ class ConfigEntityType extends EntityType { */ public function getControllerClasses() { return parent::getControllerClasses() + array( - 'storage' => 'Drupal\Core\Config\Entity\ConfigStorageController', + 'storage' => 'Drupal\Core\Config\Entity\ConfigEntityStorage', ); } diff --git a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php index cb68a0e..3729f2d 100644 --- a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php +++ b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php @@ -8,7 +8,7 @@ namespace Drupal\Core\Config\Entity; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Form\FormInterface; @@ -48,7 +48,7 @@ /** * {@inheritdoc} */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage) { parent::__construct($entity_type, $storage); // Check if the entity type supports weighting. diff --git a/core/lib/Drupal/Core/Datetime/Date.php b/core/lib/Drupal/Core/Datetime/Date.php index 5c2b92b..d079ca2 100644 --- a/core/lib/Drupal/Core/Datetime/Date.php +++ b/core/lib/Drupal/Core/Datetime/Date.php @@ -30,7 +30,7 @@ class Date { /** * The date format storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $dateFormatStorage; @@ -83,7 +83,7 @@ class Date { * The configuration factory. */ public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, TranslationInterface $translation, ConfigFactoryInterface $config_factory) { - $this->dateFormatStorage = $entity_manager->getStorageController('date_format'); + $this->dateFormatStorage = $entity_manager->getStorage('date_format'); $this->languageManager = $language_manager; $this->stringTranslation = $translation; $this->configFactory = $config_factory; diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index f63b1a0..32cf3dc 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -213,7 +213,7 @@ public function isTranslatable() { /** * {@inheritdoc} */ - public function preSaveRevision(EntityStorageControllerInterface $storage_controller, \stdClass $record) { + public function preSaveRevision(EntityStorageInterface $storage, \stdClass $record) { } /** @@ -721,7 +721,7 @@ public function addTranslation($langcode, array $values = array()) { $entity_type = $this->getEntityType(); $default_values = array($entity_type->getKey('bundle') => $this->bundle, 'langcode' => $langcode); $entity = $this->entityManager() - ->getStorageController($this->getEntityTypeId()) + ->getStorage($this->getEntityTypeId()) ->create($default_values); foreach ($entity as $name => $field) { diff --git a/core/lib/Drupal/Core/Entity/ContentEntityType.php b/core/lib/Drupal/Core/Entity/ContentEntityType.php index 14f7ee2..12e58f6 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityType.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityType.php @@ -17,7 +17,7 @@ class ContentEntityType extends EntityType { */ public function getControllerClasses() { return parent::getControllerClasses() + array( - 'storage' => 'Drupal\Core\Entity\FieldableDatabaseStorageController', + 'storage' => 'Drupal\Core\Entity\FieldableDatabaseEntityStorage', ); } diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php b/core/lib/Drupal/Core/Entity/DatabaseEntityStorage.php similarity index 96% rename from core/lib/Drupal/Core/Entity/DatabaseStorageController.php rename to core/lib/Drupal/Core/Entity/DatabaseEntityStorage.php index 2db9db5..e296f82 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/DatabaseEntityStorage.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Entity\DatabaseStorageController. + * Contains \Drupal\Core\Entity\DatabaseEntityStorage. */ namespace Drupal\Core\Entity; @@ -26,7 +26,7 @@ * * This class only supports bare, non-content entities. */ -class DatabaseStorageController extends EntityStorageControllerBase { +class DatabaseEntityStorage extends EntityStorageBase { /** * The UUID service. @@ -68,7 +68,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI } /** - * Constructs a DatabaseStorageController object. + * Constructs a DatabaseEntityStorage object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -169,14 +169,14 @@ public function load($id) { * {@inheritdoc} */ public function loadRevision($revision_id) { - throw new \Exception('Database storage controller does not support revisions.'); + throw new \Exception('Database storage does not support revisions.'); } /** * {@inheritdoc} */ public function deleteRevision($revision_id) { - throw new \Exception('Database storage controller does not support revisions.'); + throw new \Exception('Database storage does not support revisions.'); } /** diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 2bddb37..c6e1280 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -302,7 +302,7 @@ public function language() { * {@inheritdoc} */ public function save() { - return $this->entityManager()->getStorageController($this->entityTypeId)->save($this); + return $this->entityManager()->getStorage($this->entityTypeId)->save($this); } /** @@ -310,7 +310,7 @@ public function save() { */ public function delete() { if (!$this->isNew()) { - $this->entityManager()->getStorageController($this->entityTypeId)->delete(array($this->id() => $this)); + $this->entityManager()->getStorage($this->entityTypeId)->delete(array($this->id() => $this)); } } @@ -339,13 +339,13 @@ public function getEntityType() { /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { + public function preSave(EntityStorageInterface $storage) { } /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + public function postSave(EntityStorageInterface $storage, $update = TRUE) { $this->onSaveOrDelete(); if ($update) { $this->onUpdateBundleEntity(); @@ -355,25 +355,25 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { + public static function preCreate(EntityStorageInterface $storage, array &$values) { } /** * {@inheritdoc} */ - public function postCreate(EntityStorageControllerInterface $storage_controller) { + public function postCreate(EntityStorageInterface $storage) { } /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + public static function preDelete(EntityStorageInterface $storage, array $entities) { } /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + public static function postDelete(EntityStorageInterface $storage, array $entities) { foreach ($entities as $entity) { $entity->onSaveOrDelete(); } @@ -382,7 +382,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont /** * {@inheritdoc} */ - public static function postLoad(EntityStorageControllerInterface $storage_controller, array &$entities) { + public static function postLoad(EntityStorageInterface $storage, array &$entities) { } /** diff --git a/core/lib/Drupal/Core/Entity/EntityControllerInterface.php b/core/lib/Drupal/Core/Entity/EntityControllerInterface.php index a9bf653..0259e81 100644 --- a/core/lib/Drupal/Core/Entity/EntityControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityControllerInterface.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Entity; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/core/lib/Drupal/Core/Entity/EntityInterface.php b/core/lib/Drupal/Core/Entity/EntityInterface.php index ce4909a..a7cb090 100644 --- a/core/lib/Drupal/Core/Entity/EntityInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityInterface.php @@ -201,10 +201,10 @@ public function delete(); * * Used before the entity is saved and before invoking the presave hook. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The entity storage controller object. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage object. */ - public function preSave(EntityStorageControllerInterface $storage_controller); + public function preSave(EntityStorageInterface $storage); /** * Acts on a saved entity before the insert or update hook is invoked. @@ -212,67 +212,67 @@ public function preSave(EntityStorageControllerInterface $storage_controller); * Used after the entity is saved, but before invoking the insert or update * hook. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The entity storage controller object. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage object. * @param bool $update * TRUE if the entity has been updated, or FALSE if it has been inserted. */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE); + public function postSave(EntityStorageInterface $storage, $update = TRUE); /** * Changes the values of an entity before it is created. * * Load defaults for example. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The entity storage controller object. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage object. * @param array $values * An array of values to set, keyed by property name. If the entity type has * bundles the bundle key has to be specified. */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values); + public static function preCreate(EntityStorageInterface $storage, array &$values); /** * Acts on an entity after it is created but before hooks are invoked. * - * @param EntityStorageControllerInterface $storage_controller - * The entity storage controller object. + * @param EntityStorageInterface $storage + * The entity storage object. */ - public function postCreate(EntityStorageControllerInterface $storage_controller); + public function postCreate(EntityStorageInterface $storage); /** * Acts on entities before they are deleted and before hooks are invoked. * * Used before the entities are deleted and before invoking the delete hook. * - * @param EntityStorageControllerInterface $storage_controller - * The entity storage controller object. + * @param EntityStorageInterface $storage + * The entity storage object. * @param \Drupal\Core\Entity\EntityInterface[] $entities * An array of entities. */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities); + public static function preDelete(EntityStorageInterface $storage, array $entities); /** * Acts on deleted entities before the delete hook is invoked. * * Used after the entities are deleted but before invoking the delete hook. * - * @param EntityStorageControllerInterface $storage_controller - * The entity storage controller object. + * @param EntityStorageInterface $storage + * The entity storage object. * @param \Drupal\Core\Entity\EntityInterface[] $entities * An array of entities. */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities); /** * Acts on loaded entities. * - * @param EntityStorageControllerInterface $storage_controller - * The entity storage controller object. + * @param EntityStorageInterface $storage + * The entity storage object. * @param \Drupal\Core\Entity\EntityInterface[] $entities * An array of entities. */ - public static function postLoad(EntityStorageControllerInterface $storage_controller, array &$entities); + public static function postLoad(EntityStorageInterface $storage, array &$entities); /** * Creates a duplicate of the entity. diff --git a/core/lib/Drupal/Core/Entity/EntityListBuilder.php b/core/lib/Drupal/Core/Entity/EntityListBuilder.php index 626c275..5362092 100644 --- a/core/lib/Drupal/Core/Entity/EntityListBuilder.php +++ b/core/lib/Drupal/Core/Entity/EntityListBuilder.php @@ -18,9 +18,9 @@ class EntityListBuilder extends EntityControllerBase implements EntityListBuilderInterface, EntityControllerInterface { /** - * The entity storage controller class. + * The entity storage class. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $storage; @@ -44,7 +44,7 @@ class EntityListBuilder extends EntityControllerBase implements EntityListBuilde public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()) + $container->get('entity.manager')->getStorage($entity_type->id()) ); } @@ -53,10 +53,10 @@ public static function createInstance(ContainerInterface $container, EntityTypeI * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage) { $this->entityTypeId = $entity_type->id(); $this->storage = $storage; $this->entityType = $entity_type; @@ -65,7 +65,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr /** * {@inheritdoc} */ - public function getStorageController() { + public function getStorage() { return $this->storage; } diff --git a/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php b/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php index 99f5935..fce074c 100644 --- a/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php @@ -13,12 +13,12 @@ interface EntityListBuilderInterface { /** - * Gets the entity storage controller. + * Gets the entity storage. * - * @return \Drupal\Core\Entity\EntityStorageControllerInterface - * The storage controller used by this list builder. + * @return \Drupal\Core\Entity\EntityStorageInterface + * The storage used by this list builder. */ - public function getStorageController(); + public function getStorage(); /** * Loads entities of this type from storage for listing. diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 00c9d73..8ab84d0 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -184,7 +184,7 @@ public function hasController($entity_type, $controller_type) { /** * {@inheritdoc} */ - public function getStorageController($entity_type) { + public function getStorage($entity_type) { return $this->getController($entity_type, 'storage', 'getStorageClass'); } diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php index 9a65866..ce55610 100644 --- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php @@ -84,15 +84,15 @@ public function getAccessController($entity_type); public function getAdminRouteInfo($entity_type_id, $bundle); /** - * Creates a new storage controller instance. + * Creates a new storage instance. * * @param string $entity_type - * The entity type for this storage controller. + * The entity type for this storage. * - * @return \Drupal\Core\Entity\EntityStorageControllerInterface - * A storage controller instance. + * @return \Drupal\Core\Entity\EntityStorageInterface + * A storage instance. */ - public function getStorageController($entity_type); + public function getStorage($entity_type); /** * Get the bundle info of all entity types. diff --git a/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php b/core/lib/Drupal/Core/Entity/EntityStorageBase.php similarity index 94% rename from core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php rename to core/lib/Drupal/Core/Entity/EntityStorageBase.php index 7c39f19..1befefc 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageBase.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Entity\EntityStorageControllerBase. + * Contains \Drupal\Core\Entity\EntityStorageBase. */ namespace Drupal\Core\Entity; @@ -11,9 +11,9 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * A base entity storage controller class. + * A base entity storage class. */ -abstract class EntityStorageControllerBase extends EntityControllerBase implements EntityStorageControllerInterface, EntityControllerInterface { +abstract class EntityStorageBase extends EntityControllerBase implements EntityStorageInterface, EntityControllerInterface { /** * Static cache of entities. @@ -60,7 +60,7 @@ protected $uuidKey; /** - * Constructs an EntityStorageControllerBase instance. + * Constructs an EntityStorageBase instance. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php similarity index 94% rename from core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php rename to core/lib/Drupal/Core/Entity/EntityStorageInterface.php index 2658aa2..47af56a 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Entity\EntityStorageControllerInterface. + * Contains \Drupal\Core\Entity\EntityStorageInterface. */ namespace Drupal\Core\Entity; @@ -15,10 +15,10 @@ * hook_entity_type_alter() have to implement this interface. * * Most simple, SQL-based entity controllers will do better by extending - * Drupal\Core\Entity\DatabaseStorageController instead of implementing this + * Drupal\Core\Entity\DatabaseEntityStorage instead of implementing this * interface directly. */ -interface EntityStorageControllerInterface { +interface EntityStorageInterface { /** * Load the most recent version of an entity's field data. @@ -165,7 +165,7 @@ public function getQueryServicename(); * @return \Drupal\Core\Entity\Query\QueryInterface * The query instance. * - * @see \Drupal\Core\Entity\EntityStorageControllerInterface::getQueryServicename() + * @see \Drupal\Core\Entity\EntityStorageInterface::getQueryServicename() */ public function getQuery($conjunction = 'AND'); diff --git a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php index 5934322..338dc79 100644 --- a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php @@ -136,7 +136,7 @@ public function isRenderCacheable(); /** * Indicates if the persistent cache of field data should be used. * - * @todo Used by FieldableEntityStorageControllerBase only. + * @todo Used by FieldableEntityStorageBase only. * * The persistent cache should usually only be disabled if a higher level * persistent cache is available for the entity type. @@ -185,7 +185,7 @@ public function getControllerClass($controller_type); * types (listed below) and the values are the names of the classes that * implement that controller: * - storage: The name of the class used to load the objects. The class must - * implement \Drupal\Core\Entity\EntityStorageControllerInterface. + * implement \Drupal\Core\Entity\EntityStorageInterface. * - form: An associative array where the keys are the names of the * different form operations (such as 'create', 'edit', or 'delete') and * the values are the names of the controller classes for those @@ -514,7 +514,7 @@ public function getBundleLabel(); /** * Returns the name of the entity's base table. * - * @todo Used by DatabaseStorageController only. + * @todo Used by DatabaseEntityStorage only. * * @return string|bool * The name of the entity's base table, or FALSE if none exists. @@ -544,7 +544,7 @@ public function getConfigPrefix(); /** * Returns the name of the entity's revision data table. * - * @todo Used by FieldableDatabaseStorageController only. + * @todo Used by FieldableDatabaseEntityStorage only. * * @return string|bool * The name of the entity type's revision data table. @@ -554,7 +554,7 @@ public function getRevisionDataTable(); /** * Returns the name of the entity's revision table. * - * @todo Used by FieldableDatabaseStorageController only. + * @todo Used by FieldableDatabaseEntityStorage only. * * @return string|bool * The name of the entity type's revision table. @@ -564,7 +564,7 @@ public function getRevisionTable(); /** * Returns the name of the entity's data table. * - * @todo Used by FieldableDatabaseStorageController only. + * @todo Used by FieldableDatabaseEntityStorage only. * * @return string|bool * The name of the entity type's data table. diff --git a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php b/core/lib/Drupal/Core/Entity/FieldableDatabaseEntityStorage.php similarity index 98% rename from core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php rename to core/lib/Drupal/Core/Entity/FieldableDatabaseEntityStorage.php index 31b1613..c9918b9 100644 --- a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/FieldableDatabaseEntityStorage.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Entity\DatabaseStorageController. + * Contains \Drupal\Core\Entity\DatabaseEntityStorage. */ namespace Drupal\Core\Entity; @@ -20,12 +20,12 @@ /** * Defines a base entity controller class. * - * Default implementation of Drupal\Core\Entity\EntityStorageControllerInterface. + * Default implementation of Drupal\Core\Entity\EntityStorageInterface. * * This class can be used as-is by most simple entity types. Entity types * requiring special handling can extend the class. */ -class FieldableDatabaseStorageController extends FieldableEntityStorageControllerBase { +class FieldableDatabaseEntityStorage extends FieldableEntityStorageBase { /** * Name of entity's revision database table field, if it supports revisions. @@ -90,7 +90,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI } /** - * Constructs a DatabaseStorageController object. + * Constructs a DatabaseEntityStorage object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -313,7 +313,7 @@ protected function attachPropertyData(array &$entities) { } /** - * Implements \Drupal\Core\Entity\EntityStorageControllerInterface::loadRevision(). + * Implements \Drupal\Core\Entity\EntityStorageInterface::loadRevision(). */ public function loadRevision($revision_id) { // Build and execute the query. @@ -330,7 +330,7 @@ public function loadRevision($revision_id) { } /** - * Implements \Drupal\Core\Entity\EntityStorageControllerInterface::deleteRevision(). + * Implements \Drupal\Core\Entity\EntityStorageInterface::deleteRevision(). */ public function deleteRevision($revision_id) { if ($revision = $this->loadRevision($revision_id)) { @@ -379,7 +379,7 @@ protected function buildPropertyQuery(QueryInterface $entity_query, array $value * being loaded needs to be augmented with additional data from another * table, such as loading node type into comments or vocabulary machine name * into terms, however it can also support $conditions on different tables. - * See Drupal\comment\CommentStorageController::buildQuery() for an example. + * See Drupal\comment\CommentStorage::buildQuery() for an example. * * @param array|null $ids * An array of entity IDs, or NULL to load all entities. @@ -445,7 +445,7 @@ protected function buildQuery($ids, $revision_id = FALSE) { * hook_node_load() or hook_user_load(). If your hook_TYPE_load() * expects special parameters apart from the queried entities, you can set * $this->hookLoadArguments prior to calling the method. - * See Drupal\node\NodeStorageController::attachLoad() for an example. + * See Drupal\node\NodeStorage::attachLoad() for an example. * * @param $queried_entities * Associative array of query results, keyed on the entity ID. @@ -463,7 +463,7 @@ protected function postLoad(array &$queried_entities) { } /** - * Implements \Drupal\Core\Entity\EntityStorageControllerInterface::delete(). + * Implements \Drupal\Core\Entity\EntityStorageInterface::delete(). */ public function delete(array $entities) { if (!$entities) { diff --git a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php b/core/lib/Drupal/Core/Entity/FieldableEntityStorageBase.php similarity index 96% rename from core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php rename to core/lib/Drupal/Core/Entity/FieldableEntityStorageBase.php index 5d01819..9c91e3b 100644 --- a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php +++ b/core/lib/Drupal/Core/Entity/FieldableEntityStorageBase.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Entity\FieldableEntityStorageControllerBase. + * Contains \Drupal\Core\Entity\FieldableEntityStorageBase. */ namespace Drupal\Core\Entity; @@ -13,7 +13,7 @@ use Drupal\field\FieldInstanceConfigInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -abstract class FieldableEntityStorageControllerBase extends EntityStorageControllerBase implements FieldableEntityStorageControllerInterface { +abstract class FieldableEntityStorageBase extends EntityStorageBase implements FieldableEntityStorageInterface { /** * The entity bundle key. @@ -30,7 +30,7 @@ protected $entityClass; /** - * Constructs a FieldableEntityStorageControllerBase object. + * Constructs a FieldableEntityStorageBase object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -154,7 +154,7 @@ protected function loadFieldItems(array $entities) { // Fetch other entities from their storage location. if ($queried_entities) { - // Let the storage controller actually load the values. + // Let the storage actually load the values. $this->doLoadFieldItems($queried_entities, $age); // Build cache data. @@ -252,9 +252,9 @@ protected function deleteFieldItemsRevision(EntityInterface $entity) { * @param array $entities * An array of entities keyed by entity ID. * @param int $age - * EntityStorageControllerInterface::FIELD_LOAD_CURRENT to load the most + * EntityStorageInterface::FIELD_LOAD_CURRENT to load the most * recent revision for all fields, or - * EntityStorageControllerInterface::FIELD_LOAD_REVISION to load the version + * EntityStorageInterface::FIELD_LOAD_REVISION to load the version * indicated by each entity. */ abstract protected function doLoadFieldItems($entities, $age); diff --git a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerInterface.php b/core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php similarity index 95% rename from core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerInterface.php rename to core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php index c6c360f..dd694e8 100644 --- a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Entity\ExtensibleEntityStorageControllerInterface. + * Contains \Drupal\Core\Entity\ExtensibleEntityStorageInterface. */ namespace Drupal\Core\Entity; @@ -10,7 +10,7 @@ use Drupal\field\FieldConfigInterface; use Drupal\field\FieldInstanceConfigInterface; -interface FieldableEntityStorageControllerInterface extends EntityStorageControllerInterface { +interface FieldableEntityStorageInterface extends EntityStorageInterface { /** * Allows reaction to the creation of a configurable field. diff --git a/core/lib/Drupal/Core/Entity/FieldableNullStorageController.php b/core/lib/Drupal/Core/Entity/FieldableNullStorage.php similarity index 92% rename from core/lib/Drupal/Core/Entity/FieldableNullStorageController.php rename to core/lib/Drupal/Core/Entity/FieldableNullStorage.php index fd6c6d3..8e3f72b 100644 --- a/core/lib/Drupal/Core/Entity/FieldableNullStorageController.php +++ b/core/lib/Drupal/Core/Entity/FieldableNullStorage.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\Core\Entity\FieldableNullStorageController. + * Contains \Drupal\Core\Entity\FieldableNullStorage. */ namespace Drupal\Core\Entity; @@ -15,7 +15,7 @@ * * Used for content entity types that have no storage. */ -class FieldableNullStorageController extends FieldableEntityStorageControllerBase { +class FieldableNullStorage extends FieldableEntityStorageBase { /** * {@inheritdoc} diff --git a/core/lib/Drupal/Core/Entity/HtmlEntityFormController.php b/core/lib/Drupal/Core/Entity/HtmlEntityFormController.php index 44a0bf3..1efb173 100644 --- a/core/lib/Drupal/Core/Entity/HtmlEntityFormController.php +++ b/core/lib/Drupal/Core/Entity/HtmlEntityFormController.php @@ -71,7 +71,7 @@ protected function getFormObject(Request $request, $form_arg) { $entity = $request->attributes->get($entity_type); } else { - $entity = $this->manager->getStorageController($entity_type)->create(array()); + $entity = $this->manager->getStorage($entity_type)->create(array()); } return $this->manager->getFormController($entity_type, $operation)->setEntity($entity); diff --git a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php index dfa6e3a..9dd3628 100644 --- a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php +++ b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php @@ -24,7 +24,7 @@ public function validate($value, Constraint $constraint) { /** @var $entity \Drupal\Core\Entity\EntityInterface */ $entity = $this->context->getMetadata()->getTypedData()->getEntity(); if (!$entity->isNew()) { - $saved_entity = \Drupal::entityManager()->getStorageController($entity->getEntityTypeId())->loadUnchanged($entity->id()); + $saved_entity = \Drupal::entityManager()->getStorage($entity->getEntityTypeId())->loadUnchanged($entity->id()); if ($saved_entity && ($saved_entity instanceof EntityChangedInterface) && ($saved_entity->getChangedTime() > $value)) { $this->context->addViolation($constraint->message); diff --git a/core/lib/Drupal/Core/Entity/Query/QueryBase.php b/core/lib/Drupal/Core/Entity/Query/QueryBase.php index 05782dd..f5d36a1 100644 --- a/core/lib/Drupal/Core/Entity/Query/QueryBase.php +++ b/core/lib/Drupal/Core/Entity/Query/QueryBase.php @@ -8,7 +8,7 @@ namespace Drupal\Core\Entity\Query; use Drupal\Core\Database\Query\PagerSelectExtender; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; /** @@ -110,12 +110,12 @@ /** * Flag indicating whether to query the current revision or all revisions. * - * Can be either EntityStorageControllerInterface::FIELD_LOAD_CURRENT or - * EntityStorageControllerInterface::FIELD_LOAD_REVISION. + * Can be either EntityStorageInterface::FIELD_LOAD_CURRENT or + * EntityStorageInterface::FIELD_LOAD_REVISION. * * @var string */ - protected $age = EntityStorageControllerInterface::FIELD_LOAD_CURRENT; + protected $age = EntityStorageInterface::FIELD_LOAD_CURRENT; /** * The query pager data. @@ -259,7 +259,7 @@ public function accessCheck($access_check = TRUE) { /** * Implements \Drupal\Core\Entity\Query\QueryInterface::age(). */ - public function age($age = EntityStorageControllerInterface::FIELD_LOAD_CURRENT) { + public function age($age = EntityStorageInterface::FIELD_LOAD_CURRENT) { $this->age = $age; return $this; } diff --git a/core/lib/Drupal/Core/Entity/Query/QueryFactory.php b/core/lib/Drupal/Core/Entity/Query/QueryFactory.php index fff7c86..d046c87 100644 --- a/core/lib/Drupal/Core/Entity/Query/QueryFactory.php +++ b/core/lib/Drupal/Core/Entity/Query/QueryFactory.php @@ -45,7 +45,7 @@ public function __construct(EntityManagerInterface $entity_manager) { * The query object that can query the given entity type. */ public function get($entity_type_id, $conjunction = 'AND') { - $service_name = $this->entityManager->getStorageController($entity_type_id)->getQueryServicename(); + $service_name = $this->entityManager->getStorage($entity_type_id)->getQueryServicename(); return $this->container->get($service_name)->get($this->entityManager->getDefinition($entity_type_id), $conjunction); } @@ -62,7 +62,7 @@ public function get($entity_type_id, $conjunction = 'AND') { * The aggregated query object that can query the given entity type. */ public function getAggregate($entity_type_id, $conjunction = 'AND') { - $service_name = $this->entityManager->getStorageController($entity_type_id)->getQueryServicename(); + $service_name = $this->entityManager->getStorage($entity_type_id)->getQueryServicename(); return $this->container->get($service_name)->getAggregate($this->entityManager->getDefinition($entity_type_id), $conjunction); } diff --git a/core/lib/Drupal/Core/Entity/Query/QueryInterface.php b/core/lib/Drupal/Core/Entity/Query/QueryInterface.php index 4a9420b..5c22d74 100644 --- a/core/lib/Drupal/Core/Entity/Query/QueryInterface.php +++ b/core/lib/Drupal/Core/Entity/Query/QueryInterface.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Entity\Query; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Database\Query\AlterableInterface; /** @@ -159,15 +159,15 @@ public function accessCheck($access_check = TRUE); * @TODO: Once revision tables have been cleaned up, revisit this. * * @param $age - * - EntityStorageControllerInterface::FIELD_LOAD_CURRENT (default): Query + * - EntityStorageInterface::FIELD_LOAD_CURRENT (default): Query * the most recent revisions only, - * - EntityStorageControllerInterface::FIELD_LOAD_REVISION: Query all + * - EntityStorageInterface::FIELD_LOAD_REVISION: Query all * revisions. * * @return \Drupal\Core\Entity\Query\QueryInterface * The called object. */ - public function age($age = EntityStorageControllerInterface::FIELD_LOAD_CURRENT); + public function age($age = EntityStorageInterface::FIELD_LOAD_CURRENT); /** * Execute the query. diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php index 7308431..8283b43 100644 --- a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php +++ b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php @@ -8,8 +8,8 @@ namespace Drupal\Core\Entity\Query\Sql; use Drupal\Core\Database\Query\SelectInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\EntityStorageInterface; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\Core\Entity\Plugin\DataType\EntityReference; use Drupal\Core\Entity\Query\QueryException; use Drupal\field\Entity\FieldConfig; @@ -83,7 +83,7 @@ public function addField($field, $type, $langcode) { for ($key = 0; $key <= $count; $key ++) { // If there is revision support and only the current revision is being // queried then use the revision id. Otherwise, the entity id will do. - if (($revision_key = $entity_type->getKey('revision')) && $age == EntityStorageControllerInterface::FIELD_LOAD_CURRENT) { + if (($revision_key = $entity_type->getKey('revision')) && $age == EntityStorageInterface::FIELD_LOAD_CURRENT) { // This contains the relevant SQL field to be used when joining entity // tables. $entity_id_field = $revision_key; @@ -142,7 +142,7 @@ public function addField($field, $type, $langcode) { $values[$bundle_key] = reset($field_map[$entity_type_id][$field_name]['bundles']); } $entity = $entity_manager - ->getStorageController($entity_type_id) + ->getStorage($entity_type_id) ->create($values); $propertyDefinitions = $entity->$field_name->getFieldDefinition()->getPropertyDefinitions(); @@ -163,7 +163,7 @@ public function addField($field, $type, $langcode) { $column = 'value'; } $table = $this->ensureFieldTable($index_prefix, $field, $type, $langcode, $base_table, $entity_id_field, $field_id_field); - $sql_column = FieldableDatabaseStorageController::_fieldColumnName($field, $column); + $sql_column = FieldableDatabaseEntityStorage::_fieldColumnName($field, $column); } // This is an entity property (non-configurable field). else { @@ -196,7 +196,7 @@ public function addField($field, $type, $langcode) { $values[$bundle_key] = key($bundles); } $entity = $entity_manager - ->getStorageController($entity_type_id) + ->getStorage($entity_type_id) ->create($values); $propertyDefinitions = $entity->$specifier->getFieldDefinition()->getPropertyDefinitions(); $relationship_specifier = $specifiers[$key + 1]; @@ -252,7 +252,7 @@ protected function ensureEntityTable($index_prefix, $property, $type, $langcode, protected function ensureFieldTable($index_prefix, &$field, $type, $langcode, $base_table, $entity_id_field, $field_id_field) { $field_name = $field->getName(); if (!isset($this->fieldTables[$index_prefix . $field_name])) { - $table = $this->sqlQuery->getMetaData('age') == EntityStorageControllerInterface::FIELD_LOAD_CURRENT ? FieldableDatabaseStorageController::_fieldTableName($field) : FieldableDatabaseStorageController::_fieldRevisionTableName($field); + $table = $this->sqlQuery->getMetaData('age') == EntityStorageInterface::FIELD_LOAD_CURRENT ? FieldableDatabaseEntityStorage::_fieldTableName($field) : FieldableDatabaseEntityStorage::_fieldRevisionTableName($field); if ($field->getCardinality() != 1) { $this->sqlQuery->addMetaData('simple_query', FALSE); } diff --git a/core/lib/Drupal/Core/Entity/RevisionableInterface.php b/core/lib/Drupal/Core/Entity/RevisionableInterface.php index d246d24..188127c 100644 --- a/core/lib/Drupal/Core/Entity/RevisionableInterface.php +++ b/core/lib/Drupal/Core/Entity/RevisionableInterface.php @@ -56,11 +56,11 @@ public function isDefaultRevision($new_value = NULL); /** * Acts on a revision before it gets saved. * - * @param EntityStorageControllerInterface $storage_controller - * The entity storage controller object. + * @param EntityStorageInterface $storage + * The entity storage object. * @param \stdClass $record * The revision object. */ - public function preSaveRevision(EntityStorageControllerInterface $storage_controller, \stdClass $record); + public function preSaveRevision(EntityStorageInterface $storage, \stdClass $record); } diff --git a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php index cc0ffed..e906814 100644 --- a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php +++ b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php @@ -38,7 +38,7 @@ public function __construct(EntityManagerInterface $entity_manager) { */ public function convert($value, $definition, $name, array $defaults, Request $request) { $entity_type = substr($definition['type'], strlen('entity:')); - if ($storage = $this->entityManager->getStorageController($entity_type)) { + if ($storage = $this->entityManager->getStorage($entity_type)) { return $storage->load($value); } } diff --git a/core/lib/Drupal/Core/Session/UserSession.php b/core/lib/Drupal/Core/Session/UserSession.php index af33674..fb8e86b 100644 --- a/core/lib/Drupal/Core/Session/UserSession.php +++ b/core/lib/Drupal/Core/Session/UserSession.php @@ -128,7 +128,7 @@ public function hasPermission($permission) { return TRUE; } - $roles = \Drupal::entityManager()->getStorageController('user_role')->loadMultiple($this->getRoles()); + $roles = \Drupal::entityManager()->getStorage('user_role')->loadMultiple($this->getRoles()); foreach ($roles as $role) { if ($role->hasPermission($permission)) { diff --git a/core/modules/action/lib/Drupal/action/ActionAddFormController.php b/core/modules/action/lib/Drupal/action/ActionAddFormController.php index a1cf893..db02415 100644 --- a/core/modules/action/lib/Drupal/action/ActionAddFormController.php +++ b/core/modules/action/lib/Drupal/action/ActionAddFormController.php @@ -9,7 +9,7 @@ use Drupal\Component\Utility\Crypt; use Drupal\Core\Action\ActionManager; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -27,13 +27,13 @@ class ActionAddFormController extends ActionFormControllerBase { /** * Constructs a new ActionAddFormController. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The action storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The action storage. * @param \Drupal\Core\Action\ActionManager $action_manager * The action plugin manager. */ - public function __construct(EntityStorageControllerInterface $storage_controller, ActionManager $action_manager) { - parent::__construct($storage_controller); + public function __construct(EntityStorageInterface $storage, ActionManager $action_manager) { + parent::__construct($storage); $this->actionManager = $action_manager; } @@ -43,7 +43,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('action'), + $container->get('entity.manager')->getStorage('action'), $container->get('plugin.manager.action') ); } diff --git a/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php index 3cf0cde..f6dd192 100644 --- a/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php +++ b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php @@ -8,7 +8,7 @@ namespace Drupal\action; use Drupal\Core\Entity\EntityFormController; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Plugin\PluginFormInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -25,20 +25,20 @@ protected $plugin; /** - * The action storage controller. + * The action storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * Constructs a new action form. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The action storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The action storage. */ - public function __construct(EntityStorageControllerInterface $storage_controller) { - $this->storageController = $storage_controller; + public function __construct(EntityStorageInterface $storage) { + $this->storage = $storage; } /** @@ -46,7 +46,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('action') + $container->get('entity.manager')->getStorage('action') ); } @@ -106,7 +106,7 @@ public function form(array $form, array &$form_state) { * TRUE if the action exists, FALSE otherwise. */ public function exists($id) { - $action = $this->storageController->load($id); + $action = $this->storage->load($id); return !empty($action); } diff --git a/core/modules/action/lib/Drupal/action/ActionListBuilder.php b/core/modules/action/lib/Drupal/action/ActionListBuilder.php index 7ef6e19..76c4f2f 100644 --- a/core/modules/action/lib/Drupal/action/ActionListBuilder.php +++ b/core/modules/action/lib/Drupal/action/ActionListBuilder.php @@ -10,7 +10,7 @@ use Drupal\Core\Action\ActionManager; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Config\Entity\ConfigEntityListBuilder; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -39,12 +39,12 @@ class ActionListBuilder extends ConfigEntityListBuilder { * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The action storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The action storage. * @param \Drupal\Core\Action\ActionManager $action_manager * The action plugin manager. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, ActionManager $action_manager) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, ActionManager $action_manager) { parent::__construct($entity_type, $storage); $this->actionManager = $action_manager; @@ -56,7 +56,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('plugin.manager.action') ); } diff --git a/core/modules/action/lib/Drupal/action/Plugin/Action/EmailAction.php b/core/modules/action/lib/Drupal/action/Plugin/Action/EmailAction.php index a924861..ff0dca6 100644 --- a/core/modules/action/lib/Drupal/action/Plugin/Action/EmailAction.php +++ b/core/modules/action/lib/Drupal/action/Plugin/Action/EmailAction.php @@ -32,11 +32,11 @@ class EmailAction extends ConfigurableActionBase implements ContainerFactoryPlug protected $token; /** - * The user storage controller. + * The user storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * Constructs a EmailAction object. @@ -56,7 +56,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi parent::__construct($configuration, $plugin_id, $plugin_definition); $this->token = $token; - $this->storageController = $entity_manager->getStorageController('user'); + $this->storage = $entity_manager->getStorage('user'); } /** @@ -82,7 +82,7 @@ public function execute($entity = NULL) { // If the recipient is a registered user with a language preference, use // the recipient's preferred language. Otherwise, use the system default // language. - $recipient_accounts = $this->storageController->loadByProperties(array('mail' => $recipient)); + $recipient_accounts = $this->storage->loadByProperties(array('mail' => $recipient)); $recipient_account = reset($recipient_accounts); if ($recipient_account) { $langcode = $recipient_account->getPreferredLangcode(); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php b/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php index 0c3d849..f04ff1b 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php @@ -55,7 +55,7 @@ public static function create(ContainerInterface $container) { * A form array as expected by drupal_render(). */ public function feedAdd() { - $feed = $this->entityManager()->getStorageController('aggregator_feed') + $feed = $this->entityManager()->getStorage('aggregator_feed') ->create(array( 'refresh' => 3600, )); @@ -76,7 +76,7 @@ public function viewFeed(FeedInterface $aggregator_feed) { $feed_source = $entity_manager->getViewBuilder('aggregator_feed') ->view($aggregator_feed, 'default'); // Load aggregator feed item for the particular feed id. - $items = $entity_manager->getStorageController('aggregator_item')->loadByFeed($aggregator_feed->id()); + $items = $entity_manager->getStorage('aggregator_item')->loadByFeed($aggregator_feed->id()); // Print the feed items. $build = $this->buildPageList($items, $feed_source); return $build; @@ -190,7 +190,7 @@ public function adminOverview() { * The rendered list of items for the feed. */ public function pageLast() { - $items = $this->entityManager()->getStorageController('aggregator_item')->loadAll(); + $items = $this->entityManager()->getStorage('aggregator_item')->loadAll(); $build = $this->buildPageList($items); $build['#attached']['drupal_add_feed'][] = array('aggregator/rss', $this->config('system.site')->get('name') . ' ' . $this->t('aggregator')); return $build; @@ -205,7 +205,7 @@ public function pageLast() { public function sources() { $entity_manager = $this->entityManager(); - $feeds = $entity_manager->getStorageController('aggregator_feed')->loadMultiple(); + $feeds = $entity_manager->getStorage('aggregator_feed')->loadMultiple(); $build = array( '#type' => 'container', @@ -219,7 +219,7 @@ public function sources() { $aggregator_summary_items = $this->config('aggregator.settings') ->get('source.list_max'); if ($aggregator_summary_items) { - $items = $entity_manager->getStorageController('aggregator_item') + $items = $entity_manager->getStorage('aggregator_item') ->loadByFeed($feed->id()); if ($items) { $summary_items = $entity_manager->getViewBuilder('aggregator_item') diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php index 6762331..1dd4614 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php @@ -11,7 +11,7 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; use Symfony\Component\DependencyInjection\Container; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\aggregator\FeedInterface; /** @@ -21,7 +21,7 @@ * id = "aggregator_feed", * label = @Translation("Aggregator feed"), * controllers = { - * "storage" = "Drupal\aggregator\FeedStorageController", + * "storage" = "Drupal\aggregator\FeedStorage", * "view_builder" = "Drupal\aggregator\FeedViewBuilder", * "form" = { * "default" = "Drupal\aggregator\FeedFormController", @@ -80,7 +80,7 @@ public function deleteItems() { /** * {@inheritdoc} */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { + public static function preCreate(EntityStorageInterface $storage, array &$values) { $values += array( 'link' => '', 'description' => '', @@ -91,7 +91,7 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + public static function preDelete(EntityStorageInterface $storage, array $entities) { foreach ($entities as $entity) { // Notify processors to delete stored items. $manager = \Drupal::service('plugin.manager.aggregator.processor'); @@ -104,7 +104,7 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + public static function postDelete(EntityStorageInterface $storage, array $entities) { if (\Drupal::moduleHandler()->moduleExists('block')) { // Make sure there are no active blocks for these feeds. $ids = \Drupal::entityQuery('block') @@ -112,7 +112,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont ->condition('settings.feed', array_keys($entities)) ->execute(); if ($ids) { - $block_storage = \Drupal::entityManager()->getStorageController('block'); + $block_storage = \Drupal::entityManager()->getStorage('block'); $block_storage->delete($block_storage->loadMultiple($ids)); } } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php index 524e68f..19b2bbf 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php @@ -8,7 +8,7 @@ namespace Drupal\aggregator\Entity; use Drupal\Core\Entity\ContentEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\aggregator\ItemInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; @@ -20,7 +20,7 @@ * id = "aggregator_item", * label = @Translation("Aggregator feed item"), * controllers = { - * "storage" = "Drupal\aggregator\ItemStorageController", + * "storage" = "Drupal\aggregator\ItemStorage", * "view_builder" = "Drupal\aggregator\ItemViewBuilder" * }, * base_table = "aggregator_item", diff --git a/core/modules/aggregator/lib/Drupal/aggregator/FeedFormController.php b/core/modules/aggregator/lib/Drupal/aggregator/FeedFormController.php index 2edb0f0..f6a659f 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/FeedFormController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/FeedFormController.php @@ -67,8 +67,8 @@ public function form(array $form, array &$form_state) { public function validate(array $form, array &$form_state) { $feed = $this->buildEntity($form, $form_state); // Check for duplicate titles. - $feed_storage_controller = $this->entityManager->getStorageController('aggregator_feed'); - $result = $feed_storage_controller->getFeedDuplicates($feed); + $feed_storage = $this->entityManager->getStorage('aggregator_feed'); + $result = $feed_storage->getFeedDuplicates($feed); foreach ($result as $item) { if (strcasecmp($item->title, $feed->label()) == 0) { $this->setFormError('title', $form_state, $this->t('A feed named %feed already exists. Enter a unique title.', array('%feed' => $feed->label()))); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php b/core/modules/aggregator/lib/Drupal/aggregator/FeedStorage.php similarity index 71% rename from core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php rename to core/modules/aggregator/lib/Drupal/aggregator/FeedStorage.php index 4758633..1c089a7 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/FeedStorage.php @@ -2,21 +2,21 @@ /** * @file - * Contains \Drupal\aggregator\FeedStorageController. + * Contains \Drupal\aggregator\FeedStorage. */ namespace Drupal\aggregator; use Drupal\aggregator\FeedInterface; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; /** * Controller class for aggregator's feeds. * - * This extends the Drupal\Core\Entity\DatabaseStorageController class, adding + * This extends the Drupal\Core\Entity\DatabaseEntityStorage class, adding * required special handling for feed entities. */ -class FeedStorageController extends FieldableDatabaseStorageController implements FeedStorageControllerInterface { +class FeedStorage extends FieldableDatabaseEntityStorage implements FeedStorageInterface { /** * {@inheritdoc} diff --git a/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageControllerInterface.php b/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageInterface.php similarity index 68% rename from core/modules/aggregator/lib/Drupal/aggregator/FeedStorageControllerInterface.php rename to core/modules/aggregator/lib/Drupal/aggregator/FeedStorageInterface.php index aade8b9..e280743 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageControllerInterface.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageInterface.php @@ -2,18 +2,18 @@ /** * @file - * Contains \Drupal\aggregator\FeedStorageControllerInterface. + * Contains \Drupal\aggregator\FeedStorageInterface. */ namespace Drupal\aggregator; use Drupal\aggregator\FeedInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines a common interface for aggregator feed entity controller classes. */ -interface FeedStorageControllerInterface extends EntityStorageControllerInterface { +interface FeedStorageInterface extends EntityStorageInterface { /** * Provides a list of duplicate feeds. diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php index 1ba376b..4284ee1 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php @@ -7,7 +7,7 @@ namespace Drupal\aggregator\Form; -use Drupal\aggregator\FeedStorageControllerInterface; +use Drupal\aggregator\FeedStorageInterface; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Form\FormBase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -23,9 +23,9 @@ class OpmlFeedAdd extends FormBase { /** * The feed storage. * - * @var \Drupal\aggregator\FeedStorageControllerInterface + * @var \Drupal\aggregator\FeedStorageInterface */ - protected $feedStorageController; + protected $feedStorage; /** * The HTTP client to fetch the feed data with. @@ -37,13 +37,13 @@ class OpmlFeedAdd extends FormBase { /** * Constructs a database object. * - * @param \Drupal\aggregator\FeedStorageControllerInterface $feed_storage + * @param \Drupal\aggregator\FeedStorageInterface $feed_storage * The feed storage. * @param \Guzzle\Http\ClientInterface $http_client * The Guzzle HTTP client. */ - public function __construct(FeedStorageControllerInterface $feed_storage, ClientInterface $http_client) { - $this->feedStorageController = $feed_storage; + public function __construct(FeedStorageInterface $feed_storage, ClientInterface $http_client) { + $this->feedStorage = $feed_storage; $this->httpClient = $http_client; } @@ -52,7 +52,7 @@ public function __construct(FeedStorageControllerInterface $feed_storage, Client */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('aggregator_feed'), + $container->get('entity.manager')->getStorage('aggregator_feed'), $container->get('http_default_client') ); } @@ -152,14 +152,14 @@ public function submitForm(array &$form, array &$form_state) { } // Check for duplicate titles or URLs. - $query = $this->feedStorageController->getQuery(); + $query = $this->feedStorage->getQuery(); $condition = $query->orConditionGroup() ->condition('title', $feed['title']) ->condition('url', $feed['url']); $ids = $query ->condition($condition) ->execute(); - $result = $this->feedStorageController->loadMultiple($ids); + $result = $this->feedStorage->loadMultiple($ids); foreach ($result as $old) { if (strcasecmp($old->label(), $feed['title']) == 0) { drupal_set_message($this->t('A feed named %title already exists.', array('%title' => $old->label())), 'warning'); @@ -171,7 +171,7 @@ public function submitForm(array &$form, array &$form_state) { } } - $new_feed = $this->feedStorageController->create(array( + $new_feed = $this->feedStorage->create(array( 'title' => $feed['title'], 'url' => $feed['url'], 'refresh' => $form_state['values']['refresh'], diff --git a/core/modules/aggregator/lib/Drupal/aggregator/ItemStorageController.php b/core/modules/aggregator/lib/Drupal/aggregator/ItemStorage.php similarity index 83% rename from core/modules/aggregator/lib/Drupal/aggregator/ItemStorageController.php rename to core/modules/aggregator/lib/Drupal/aggregator/ItemStorage.php index a755c21..eccf620 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/ItemStorageController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/ItemStorage.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\aggregator\ItemStorageController. + * Contains \Drupal\aggregator\ItemStorage. */ namespace Drupal\aggregator; @@ -10,15 +10,15 @@ use Drupal\aggregator\Entity\Item; use Drupal\Core\Database\Query\PagerSelectExtender; use Drupal\Core\Database\Query\SelectInterface; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; /** * Controller class for aggregators items. * - * This extends the Drupal\Core\Entity\DatabaseStorageController class, adding + * This extends the Drupal\Core\Entity\DatabaseEntityStorage class, adding * required special handling for feed item entities. */ -class ItemStorageController extends FieldableDatabaseStorageController implements ItemStorageControllerInterface { +class ItemStorage extends FieldableDatabaseEntityStorage implements ItemStorageInterface { /** * {@inheritdoc} diff --git a/core/modules/aggregator/lib/Drupal/aggregator/ItemStorageControllerInterface.php b/core/modules/aggregator/lib/Drupal/aggregator/ItemStorageInterface.php similarity index 79% rename from core/modules/aggregator/lib/Drupal/aggregator/ItemStorageControllerInterface.php rename to core/modules/aggregator/lib/Drupal/aggregator/ItemStorageInterface.php index a191352..18176af 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/ItemStorageControllerInterface.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/ItemStorageInterface.php @@ -2,18 +2,18 @@ /** * @file - * Contains Drupal\aggregator\ItemStorageControllerInterface. + * Contains Drupal\aggregator\ItemStorageInterface. */ namespace Drupal\aggregator; use Drupal\aggregator\Entity\Item; -use Drupal\core\Entity\EntityStorageControllerInterface; +use Drupal\core\Entity\EntityStorageInterface; /** * Defines a common interface for aggregator item entity controller classes. */ -interface ItemStorageControllerInterface extends EntityStorageControllerInterface { +interface ItemStorageInterface extends EntityStorageInterface { /** * Loads feed items from all feeds. diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php index 4547527..6a370fe 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php @@ -9,7 +9,7 @@ use Drupal\block\BlockBase; use Drupal\Core\Database\Connection; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -26,11 +26,11 @@ class AggregatorFeedBlock extends BlockBase implements ContainerFactoryPluginInterface { /** - * The entity storage controller for feeds. + * The entity storage for feeds. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The database connection. @@ -48,14 +48,14 @@ class AggregatorFeedBlock extends BlockBase implements ContainerFactoryPluginInt * The plugin_id for the plugin instance. * @param array $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The entity storage controller for feeds. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage for feeds. * @param \Drupal\Core\Database\Connection $connection * The database connection. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageControllerInterface $storage_controller, Connection $connection) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage, Connection $connection) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->storageController = $storage_controller; + $this->storage = $storage; $this->connection = $connection; } @@ -68,7 +68,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration, $plugin_id, $plugin_definition, - $container->get('entity.manager')->getStorageController('aggregator_feed'), + $container->get('entity.manager')->getStorage('aggregator_feed'), $container->get('database') ); } @@ -97,7 +97,7 @@ public function access(AccountInterface $account) { * Overrides \Drupal\block\BlockBase::blockForm(). */ public function blockForm($form, &$form_state) { - $feeds = $this->storageController->loadMultiple(); + $feeds = $this->storage->loadMultiple(); $options = array(); foreach ($feeds as $feed) { $options[$feed->id()] = $feed->label(); @@ -131,7 +131,7 @@ public function blockSubmit($form, &$form_state) { */ public function build() { // Load the selected feed. - if ($feed = $this->storageController->load($this->configuration['feed'])) { + if ($feed = $this->storage->load($this->configuration['feed'])) { $result = $this->connection->queryRange("SELECT * FROM {aggregator_item} WHERE fid = :fid ORDER BY timestamp DESC, iid DESC", 0, $this->configuration['block_count'], array(':fid' => $feed->id())); $more_link = array( '#theme' => 'more_link', diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Fid.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Fid.php index b6601c2..9b3b99a 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Fid.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Fid.php @@ -58,7 +58,7 @@ public static function create(ContainerInterface $container, array $configuratio function titleQuery() { $titles = array(); - $feeds = $this->entityManager->getStorageController('aggregator_feed')->loadMultiple($this->value); + $feeds = $this->entityManager->getStorage('aggregator_feed')->loadMultiple($this->value); foreach ($feeds as $feed) { $titles[] = String::checkPlain($feed->label()); } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Iid.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Iid.php index 2fef3be..6f4b62e 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Iid.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/argument/Iid.php @@ -58,7 +58,7 @@ public static function create(ContainerInterface $container, array $configuratio function titleQuery() { $titles = array(); - $items = $this->entityManager->getStorageController('aggregator_item')->loadMultiple($this->value); + $items = $this->entityManager->getStorage('aggregator_item')->loadMultiple($this->value); foreach ($items as $feed) { $titles[] = String::checkPlain($feed->label()); } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/DeleteFeedTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/DeleteFeedTest.php index db38dec..69406d6 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/DeleteFeedTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/DeleteFeedTest.php @@ -45,7 +45,7 @@ function testDeleteFeed() { // Delete feed. $this->deleteFeed($feed1); $this->assertText($feed2->label()); - $block_storage = $this->container->get('entity.manager')->getStorageController('block'); + $block_storage = $this->container->get('entity.manager')->getStorage('block'); $this->assertNull($block_storage->load($block->id()), 'Block for the deleted feed was deleted.'); $this->assertEqual($block2->id(), $block_storage->load($block2->id())->id(), 'Block for not deleted feed still exists.'); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php index f129067..3f4d7b5 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php @@ -31,18 +31,18 @@ class IntegrationTest extends ViewUnitTestBase { public static $testViews = array('test_aggregator_items'); /** - * The entity storage controller for aggregator items. + * The entity storage for aggregator items. * - * @var \Drupal\aggregator\ItemStorageController + * @var \Drupal\aggregator\ItemStorage */ - protected $itemStorageController; + protected $itemStorage; /** - * The entity storage controller for aggregator feeds. + * The entity storage for aggregator feeds. * - * @var \Drupal\aggregator\FeedStorageController + * @var \Drupal\aggregator\FeedStorage */ - protected $feedStorageController; + protected $feedStorage; public static function getInfo() { return array( @@ -59,8 +59,8 @@ protected function setUp() { ViewTestData::createTestViews(get_class($this), array('aggregator_test_views')); - $this->itemStorageController = $this->container->get('entity.manager')->getStorageController('aggregator_item'); - $this->feedStorageController = $this->container->get('entity.manager')->getStorageController('aggregator_feed'); + $this->itemStorage = $this->container->get('entity.manager')->getStorage('aggregator_item'); + $this->feedStorage = $this->container->get('entity.manager')->getStorage('aggregator_feed'); } /** @@ -79,7 +79,7 @@ public function testAggregatorItemView() { $values['link'] = 'http://drupal.org/node/' . mt_rand(1000, 10000); $values['guid'] = $this->randomString(); - $aggregator_item = $this->itemStorageController->create($values); + $aggregator_item = $this->itemStorage->create($values); $aggregator_item->save(); $items[$aggregator_item->id()] = $aggregator_item; diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php index 3ed3842..e30c42d 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Controller/CustomBlockController.php @@ -9,7 +9,7 @@ use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\custom_block\CustomBlockTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -17,16 +17,16 @@ class CustomBlockController extends ControllerBase { /** - * The custom block storage controller. + * The custom block storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $customBlockStorage; /** - * The custom block type storage controller. + * The custom block type storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $customBlockTypeStorage; @@ -36,20 +36,20 @@ class CustomBlockController extends ControllerBase { public static function create(ContainerInterface $container) { $entity_manager = $container->get('entity.manager'); return new static( - $entity_manager->getStorageController('custom_block'), - $entity_manager->getStorageController('custom_block_type') + $entity_manager->getStorage('custom_block'), + $entity_manager->getStorage('custom_block_type') ); } /** * Constructs a CustomBlock object. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $custom_block_storage - * The custom block storage controller. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $custom_block_type_storage - * The custom block type storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $custom_block_storage + * The custom block storage. + * @param \Drupal\Core\Entity\EntityStorageInterface $custom_block_type_storage + * The custom block type storage. */ - public function __construct(EntityStorageControllerInterface $custom_block_storage, EntityStorageControllerInterface $custom_block_type_storage) { + public function __construct(EntityStorageInterface $custom_block_storage, EntityStorageInterface $custom_block_type_storage) { $this->customBlockStorage = $custom_block_storage; $this->customBlockTypeStorage = $custom_block_type_storage; } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php index 4ad8ba9..3fa55d6 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php @@ -10,7 +10,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\ContentEntityFormController; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageManager; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -23,7 +23,7 @@ class CustomBlockFormController extends ContentEntityFormController { /** * The custom block storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $customBlockStorage; @@ -39,12 +39,12 @@ class CustomBlockFormController extends ContentEntityFormController { * * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $custom_block_storage - * The custom block storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $custom_block_storage + * The custom block storage. * @param \Drupal\Core\Language\LanguageManager $language_manager * The language manager. */ - public function __construct(EntityManagerInterface $entity_manager, EntityStorageControllerInterface $custom_block_storage, LanguageManager $language_manager) { + public function __construct(EntityManagerInterface $entity_manager, EntityStorageInterface $custom_block_storage, LanguageManager $language_manager) { parent::__construct($entity_manager); $this->customBlockStorage = $custom_block_storage; $this->languageManager = $language_manager; @@ -57,7 +57,7 @@ public static function create(ContainerInterface $container) { $entity_manager = $container->get('entity.manager'); return new static( $entity_manager, - $entity_manager->getStorageController('custom_block'), + $entity_manager->getStorage('custom_block'), $container->get('language_manager') ); } diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php index ea20a79..9ae7339 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php @@ -8,7 +8,7 @@ namespace Drupal\custom_block\Entity; use Drupal\Core\Entity\ContentEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; use Drupal\custom_block\CustomBlockInterface; @@ -101,8 +101,8 @@ public function getTheme() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); // Invalidate the block cache to update custom block-based derivatives. \Drupal::service('plugin.manager.block')->clearCachedDefinitions(); @@ -118,8 +118,8 @@ public function getInstances() { /** * {@inheritdoc} */ - public function preSaveRevision(EntityStorageControllerInterface $storage_controller, \stdClass $record) { - parent::preSaveRevision($storage_controller, $record); + public function preSaveRevision(EntityStorageInterface $storage, \stdClass $record) { + parent::preSaveRevision($storage, $record); if ($this->isNewRevision()) { // When inserting either a new custom block or a new custom_block diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php index 57ed007..e8eee2e 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php @@ -8,7 +8,7 @@ namespace Drupal\custom_block\Entity; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\custom_block\CustomBlockTypeInterface; /** @@ -72,8 +72,8 @@ class CustomBlockType extends ConfigEntityBase implements CustomBlockTypeInterfa /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); if (!$update) { entity_invoke_bundle_hook('create', 'custom_block', $this->id()); @@ -89,8 +89,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); foreach ($entities as $entity) { entity_invoke_bundle_hook('delete', 'custom_block', $entity->id()); diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php index fa7cc8f..5e5bd08 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockListTest.php @@ -82,7 +82,7 @@ public function testListing() { // Edit the entity using the operations link. $blocks = $this->container ->get('entity.manager') - ->getStorageController('custom_block') + ->getStorage('custom_block') ->loadByProperties(array('info' => $label)); $block = reset($blocks); if (!empty($block)) { diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php index 82cb852..d107ad7 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php @@ -146,10 +146,10 @@ public function testsCustomBlockAddTypes() { $type = $this->createCustomBlockType('foo'); $type = $this->createCustomBlockType('bar'); - // Get the custom block storage controller. - $storage_controller = $this->container + // Get the custom block storage. + $storage = $this->container ->get('entity.manager') - ->getStorageController('custom_block'); + ->getStorage('custom_block'); // Enable all themes. theme_enable(array('bartik', 'seven')); @@ -180,7 +180,7 @@ public function testsCustomBlockAddTypes() { // Create a new block. $edit = array('info' => $this->randomName(8)); $this->drupalPostForm(NULL, $edit, t('Save')); - $blocks = $storage_controller->loadByProperties(array('info' => $edit['info'])); + $blocks = $storage->loadByProperties(array('info' => $edit['info'])); if (!empty($blocks)) { $block = reset($blocks); $destination = 'admin/structure/block/add/custom_block:' . $block->uuid() . '/' . $theme; @@ -201,7 +201,7 @@ public function testsCustomBlockAddTypes() { $this->clickLink('foo'); $edit = array('info' => $this->randomName(8)); $this->drupalPostForm(NULL, $edit, t('Save')); - $blocks = $storage_controller->loadByProperties(array('info' => $edit['info'])); + $blocks = $storage->loadByProperties(array('info' => $edit['info'])); if (!empty($blocks)) { $destination = 'admin/structure/block/custom-blocks'; $this->assertUrl(url($destination, array('absolute' => TRUE))); diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php index 4ce4c81..c4efba1 100644 --- a/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -29,11 +29,11 @@ class BlockFormController extends EntityFormController { protected $entity; /** - * The block storage controller. + * The block storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The language manager. @@ -60,7 +60,7 @@ class BlockFormController extends EntityFormController { * The config factory. */ public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory) { - $this->storageController = $entity_manager->getStorageController('block'); + $this->storage = $entity_manager->getStorage('block'); $this->languageManager = $language_manager; $this->configFactory = $config_factory; } @@ -361,7 +361,7 @@ public function getUniqueMachineName(BlockInterface $block) { $suggestion = $block->getPlugin()->getMachineNameSuggestion(); // Get all the blocks which starts with the suggested machine name. - $query = $this->storageController->getQuery(); + $query = $this->storage->getQuery(); $query->condition('id', $suggestion, 'CONTAINS'); $block_ids = $query->execute(); diff --git a/core/modules/block/lib/Drupal/block/BlockListBuilder.php b/core/modules/block/lib/Drupal/block/BlockListBuilder.php index 31b3286..1b93f8c 100644 --- a/core/modules/block/lib/Drupal/block/BlockListBuilder.php +++ b/core/modules/block/lib/Drupal/block/BlockListBuilder.php @@ -13,7 +13,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Form\FormInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -59,12 +59,12 @@ class BlockListBuilder extends ConfigEntityListBuilder implements FormInterface * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. * @param \Drupal\Component\Plugin\PluginManagerInterface $block_manager * The block manager. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, PluginManagerInterface $block_manager) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, PluginManagerInterface $block_manager) { parent::__construct($entity_type, $storage); $this->blockManager = $block_manager; @@ -76,7 +76,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('plugin.manager.block') ); } diff --git a/core/modules/block/lib/Drupal/block/Controller/BlockAddController.php b/core/modules/block/lib/Drupal/block/Controller/BlockAddController.php index 716bc6e..dacfde3 100644 --- a/core/modules/block/lib/Drupal/block/Controller/BlockAddController.php +++ b/core/modules/block/lib/Drupal/block/Controller/BlockAddController.php @@ -28,7 +28,7 @@ class BlockAddController extends ControllerBase { */ public function blockAddConfigureForm($plugin_id, $theme) { // Create a block entity. - $entity = $this->entityManager()->getStorageController('block')->create(array('plugin' => $plugin_id, 'theme' => $theme)); + $entity = $this->entityManager()->getStorage('block')->create(array('plugin' => $plugin_id, 'theme' => $theme)); return $this->entityFormBuilder()->getForm($entity); } diff --git a/core/modules/block/lib/Drupal/block/Entity/Block.php b/core/modules/block/lib/Drupal/block/Entity/Block.php index 94fe675..9e17171 100644 --- a/core/modules/block/lib/Drupal/block/Entity/Block.php +++ b/core/modules/block/lib/Drupal/block/Entity/Block.php @@ -13,7 +13,7 @@ use Drupal\block\BlockInterface; use Drupal\Core\Config\Entity\ConfigEntityInterface; use Drupal\Core\Config\Entity\EntityWithPluginBagInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines a Block configuration entity class. @@ -151,8 +151,8 @@ public function toArray() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); if ($update) { Cache::invalidateTags(array('block' => $this->id())); @@ -168,8 +168,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); Cache::invalidateTags(array('block' => array_keys($entities))); } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php index 1a7ea82..b6aa269 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockRenderOrderTest.php @@ -75,7 +75,7 @@ function testBlockRenderOrder() { $this->drupalGet(''); $test_content = $this->drupalGetContent(''); - $controller = $this->container->get('entity.manager')->getStorageController('block'); + $controller = $this->container->get('entity.manager')->getStorage('block'); foreach ($controller->loadMultiple() as $return_block) { $id = $return_block->get('id'); if ($return_block_weight = $return_block->get('weight')) { diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php index e63fb2b..79c572e 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php @@ -7,7 +7,7 @@ namespace Drupal\block\Tests; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\simpletest\DrupalUnitTestBase; use Drupal\block_test\Plugin\Block\TestHtmlBlock; use Drupal\Component\Plugin\Exception\PluginException; @@ -27,9 +27,9 @@ class BlockStorageUnitTest extends DrupalUnitTestBase { public static $modules = array('block', 'block_test', 'system'); /** - * The block storage controller. + * The block storage. * - * @var \Drupal\Core\Config\Entity\ConfigStorageControllerInterface. + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface. */ protected $controller; @@ -44,14 +44,14 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - $this->controller = $this->container->get('entity.manager')->getStorageController('block'); + $this->controller = $this->container->get('entity.manager')->getStorage('block'); } /** * Tests CRUD operations. */ public function testBlockCRUD() { - $this->assertTrue($this->controller instanceof ConfigStorageController, 'The block storage controller is loaded.'); + $this->assertTrue($this->controller instanceof ConfigEntityStorage, 'The block storage is loaded.'); // Run each test method in the same installation. $this->createTests(); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php b/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php index 39aa634..88073c3 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php @@ -66,7 +66,7 @@ function setUp() { 'sidebar_second', 'footer', ); - $block_storage = $this->container->get('entity.manager')->getStorageController('block'); + $block_storage = $this->container->get('entity.manager')->getStorage('block'); $blocks = $block_storage->loadByProperties(array('theme' => \Drupal::config('system.theme')->get('default'))); foreach ($blocks as $block) { $block->delete(); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockViewBuilderTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockViewBuilderTest.php index aa7dd2e..1ef3598 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockViewBuilderTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockViewBuilderTest.php @@ -32,9 +32,9 @@ class BlockViewBuilderTest extends DrupalUnitTestBase { protected $block; /** - * The block storage controller. + * The block storage. * - * @var \Drupal\Core\Config\Entity\ConfigStorageControllerInterface + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface */ protected $controller; @@ -57,7 +57,7 @@ public function setUp() { $this->controller = $this->container ->get('entity.manager') - ->getStorageController('block'); + ->getStorage('block'); \Drupal::state()->set('block_test.content', 'Llamas > unicorns!'); diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php index ab13127..ca906ea 100644 --- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -143,7 +143,7 @@ protected function testDeleteBlockDisplay() { $this->assertBlockAppears($block_3); $this->assertBlockAppears($block_4); - $block_storage_controller = $this->container->get('entity.manager')->getStorageController('block'); + $block_storage = $this->container->get('entity.manager')->getStorage('block'); // Remove the block display, so both block entities from the first view // should both disappear. @@ -152,10 +152,10 @@ protected function testDeleteBlockDisplay() { $view->displayHandlers->remove('block_1'); $view->storage->save(); - $this->assertFalse($block_storage_controller->load($block_1->id()), 'The block for this display was removed.'); - $this->assertFalse($block_storage_controller->load($block_2->id()), 'The block for this display was removed.'); - $this->assertTrue($block_storage_controller->load($block_3->id()), 'A block from another view was unaffected.'); - $this->assertTrue($block_storage_controller->load($block_4->id()), 'A block from another view was unaffected.'); + $this->assertFalse($block_storage->load($block_1->id()), 'The block for this display was removed.'); + $this->assertFalse($block_storage->load($block_2->id()), 'The block for this display was removed.'); + $this->assertTrue($block_storage->load($block_3->id()), 'A block from another view was unaffected.'); + $this->assertTrue($block_storage->load($block_4->id()), 'A block from another view was unaffected.'); $this->drupalGet('test-page'); $this->assertNoBlockAppears($block_1); $this->assertNoBlockAppears($block_2); @@ -169,8 +169,8 @@ protected function testDeleteBlockDisplay() { $view->displayHandlers->remove('block_1'); $view->storage->save(); - $this->assertFalse($block_storage_controller->load($block_3->id()), 'The block for this display was removed.'); - $this->assertTrue($block_storage_controller->load($block_4->id()), 'A block from another display on the same view was unaffected.'); + $this->assertFalse($block_storage->load($block_3->id()), 'The block for this display was removed.'); + $this->assertTrue($block_storage->load($block_4->id()), 'A block from another display on the same view was unaffected.'); $this->drupalGet('test-page'); $this->assertNoBlockAppears($block_3); $this->assertBlockAppears($block_4); @@ -190,7 +190,7 @@ public function testViewsBlockForm() { $this->assertNoFieldById('edit-machine-name', 'views_block__test_view_block_1', 'The machine name is hidden on the views block form.'); // Save the block. $this->drupalPostForm(NULL, array(), t('Save block')); - $storage = $this->container->get('entity.manager')->getStorageController('block'); + $storage = $this->container->get('entity.manager')->getStorage('block'); $block = $storage->load('views_block__test_view_block_block_1'); // This will only return a result if our new block has been created with the // expected machine name. diff --git a/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php b/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php index aa54731..760060b 100644 --- a/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php +++ b/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php @@ -47,7 +47,7 @@ public function testGetUniqueMachineName() { ->method('execute') ->will($this->returnValue(array('test', 'other_test', 'other_test_1', 'other_test_2'))); - $block_storage = $this->getMock('Drupal\Core\Config\Entity\ConfigStorageControllerInterface'); + $block_storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); $block_storage->expects($this->exactly(5)) ->method('getQuery') ->will($this->returnValue($query)); @@ -55,7 +55,7 @@ public function testGetUniqueMachineName() { $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); $entity_manager->expects($this->any()) - ->method('getStorageController') + ->method('getStorage') ->will($this->returnValue($block_storage)); $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface'); diff --git a/core/modules/book/lib/Drupal/book/BookBreadcrumbBuilder.php b/core/modules/book/lib/Drupal/book/BookBreadcrumbBuilder.php index 0f16d1f..1f8ff83 100644 --- a/core/modules/book/lib/Drupal/book/BookBreadcrumbBuilder.php +++ b/core/modules/book/lib/Drupal/book/BookBreadcrumbBuilder.php @@ -19,9 +19,9 @@ class BookBreadcrumbBuilder extends BreadcrumbBuilderBase { /** - * The node storage controller. + * The node storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $nodeStorage; @@ -50,7 +50,7 @@ class BookBreadcrumbBuilder extends BreadcrumbBuilderBase { * The current user account. */ public function __construct(EntityManagerInterface $entity_manager, AccessManager $access_manager, AccountInterface $account) { - $this->nodeStorage = $entity_manager->getStorageController('node'); + $this->nodeStorage = $entity_manager->getStorage('node'); $this->accessManager = $access_manager; $this->account = $account; } diff --git a/core/modules/book/lib/Drupal/book/BookExport.php b/core/modules/book/lib/Drupal/book/BookExport.php index 4d220c9..b03de15 100644 --- a/core/modules/book/lib/Drupal/book/BookExport.php +++ b/core/modules/book/lib/Drupal/book/BookExport.php @@ -18,9 +18,9 @@ class BookExport { /** - * The node storage controller. + * The node storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $nodeStorage; @@ -38,7 +38,7 @@ class BookExport { * The entity manager. */ public function __construct(EntityManagerInterface $entityManager) { - $this->nodeStorage = $entityManager->getStorageController('node'); + $this->nodeStorage = $entityManager->getStorage('node'); $this->viewBuilder = $entityManager->getViewBuilder('node'); } diff --git a/core/modules/book/lib/Drupal/book/BookManager.php b/core/modules/book/lib/Drupal/book/BookManager.php index 7b4f3f0..76c7b84 100644 --- a/core/modules/book/lib/Drupal/book/BookManager.php +++ b/core/modules/book/lib/Drupal/book/BookManager.php @@ -96,7 +96,7 @@ protected function loadBooks() { $query->addMetaData('base_table', 'book'); $book_links = $query->execute(); - $nodes = $this->entityManager->getStorageController('node')->loadMultiple($nids); + $nodes = $this->entityManager->getStorage('node')->loadMultiple($nids); // @todo: Sort by weight and translated title. // @todo: use route name for links, not system path. @@ -399,7 +399,7 @@ protected function recurseTableOfContents(array $tree, $indent, array &$toc, arr } } - $nodes = $this->entityManager->getStorageController('node')->loadMultiple($nids); + $nodes = $this->entityManager->getStorage('node')->loadMultiple($nids); foreach ($tree as $data) { $nid = $data['link']['nid']; @@ -534,7 +534,7 @@ public function bookTreeOutput(array $tree) { $element['#theme'] = 'book_link__book_toc_' . $data['link']['bid']; $element['#attributes']['class'] = $class; $element['#title'] = $data['link']['title']; - $node = \Drupal::entityManager()->getStorageController('node')->load($data['link']['nid']); + $node = \Drupal::entityManager()->getStorage('node')->load($data['link']['nid']); $element['#href'] = $node->url(); $element['#localized_options'] = !empty($data['link']['localized_options']) ? $data['link']['localized_options'] : array(); $element['#below'] = $data['below'] ? $this->bookTreeOutput($data['below']) : $data['below']; @@ -937,14 +937,14 @@ public function bookLinkTranslate(&$link) { $node = NULL; // Access will already be set in the tree functions. if (!isset($link['access'])) { - $node = $this->entityManager->getStorageController('node')->load($link['nid']); + $node = $this->entityManager->getStorage('node')->load($link['nid']); $link['access'] = $node && $node->access('view'); } // For performance, don't localize a link the user can't access. if ($link['access']) { // @todo - load the nodes en-mass rather than individually. if (!$node) { - $node = $this->entityManager->getStorageController('node') + $node = $this->entityManager->getStorage('node') ->load($link['nid']); } // The node label will be the value for the current user's language. diff --git a/core/modules/book/lib/Drupal/book/Form/BookAdminEditForm.php b/core/modules/book/lib/Drupal/book/Form/BookAdminEditForm.php index 41dfad2..780e554 100644 --- a/core/modules/book/lib/Drupal/book/Form/BookAdminEditForm.php +++ b/core/modules/book/lib/Drupal/book/Form/BookAdminEditForm.php @@ -10,7 +10,7 @@ use Drupal\book\BookManagerInterface; use Drupal\Component\Utility\Crypt; use Drupal\Core\Cache\CacheBackendInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Form\FormBase; use Drupal\node\NodeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -28,9 +28,9 @@ class BookAdminEditForm extends FormBase { protected $cache; /** - * The node storage controller. + * The node storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $nodeStorage; @@ -46,12 +46,12 @@ class BookAdminEditForm extends FormBase { * * @param \Drupal\Core\Cache\CacheBackendInterface $cache * The menu cache object to be used by this controller. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $node_storage - * The custom block storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $node_storage + * The custom block storage. * @param \Drupal\book\BookManagerInterface $book_manager * The book manager. */ - public function __construct(CacheBackendInterface $cache, EntityStorageControllerInterface $node_storage, BookManagerInterface $book_manager) { + public function __construct(CacheBackendInterface $cache, EntityStorageInterface $node_storage, BookManagerInterface $book_manager) { $this->cache = $cache; $this->nodeStorage = $node_storage; $this->bookManager = $book_manager; @@ -64,7 +64,7 @@ public static function create(ContainerInterface $container) { $entity_manager = $container->get('entity.manager'); return new static( $container->get('cache.menu'), - $entity_manager->getStorageController('node'), + $entity_manager->getStorage('node'), $container->get('book.manager') ); } diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php index 36f8e12..667f089 100644 --- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php +++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php @@ -271,7 +271,7 @@ function createBookNode($book_nid, $parent = NULL) { $edit['book[pid]'] = $parent; $this->drupalPostForm(NULL, $edit, t('Save')); // Make sure the parent was flagged as having children. - $parent_node = \Drupal::entityManager()->getStorageController('node')->loadUnchanged($parent); + $parent_node = \Drupal::entityManager()->getStorage('node')->loadUnchanged($parent); $this->assertFalse(empty($parent_node->book['has_children']), 'Parent node is marked as having children'); } else { @@ -550,7 +550,7 @@ public function testBookOutline() { $edit = array(); $edit['book[bid]'] = '1'; $this->drupalPostForm('node/' . $empty_book->id() . '/outline', $edit, t('Add to book outline')); - $node = \Drupal::entityManager()->getStorageController('node')->load($empty_book->id()); + $node = \Drupal::entityManager()->getStorage('node')->load($empty_book->id()); // Test the book array. $this->assertEqual($node->book['nid'], $empty_book->id()); $this->assertEqual($node->book['bid'], $empty_book->id()); @@ -571,7 +571,7 @@ public function testBookOutline() { $edit = array(); $edit['book[bid]'] = $node->id(); $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); - $node = \Drupal::entityManager()->getStorageController('node')->load($node->id()); + $node = \Drupal::entityManager()->getStorage('node')->load($node->id()); // Test the book array. $this->assertEqual($node->book['nid'], $node->id()); diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module index be06abd..19fe29f 100644 --- a/core/modules/breakpoint/breakpoint.module +++ b/core/modules/breakpoint/breakpoint.module @@ -7,7 +7,7 @@ use Drupal\breakpoint\Entity\Breakpoint; use Drupal\breakpoint\Entity\BreakpointGroup; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; /** * Implements hook_help(). diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php index eab45d9..e200894 100644 --- a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php +++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/Breakpoint.php @@ -14,7 +14,7 @@ use Drupal\breakpoint\InvalidBreakpointSourceException; use Drupal\breakpoint\InvalidBreakpointSourceTypeException; use Drupal\breakpoint\InvalidBreakpointMediaQueryException; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines the Breakpoint entity. diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php index 738f3b2..9840657d 100644 --- a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php +++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php @@ -11,7 +11,7 @@ use Drupal\breakpoint\BreakpointGroupInterface; use Drupal\breakpoint\InvalidBreakpointSourceException; use Drupal\breakpoint\InvalidBreakpointSourceTypeException; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines the BreakpointGroup entity. diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install index de9c0c8..40fb1a0 100644 --- a/core/modules/comment/comment.install +++ b/core/modules/comment/comment.install @@ -25,7 +25,7 @@ function comment_uninstall() { */ function comment_install() { // By default, maintain entity statistics for comments. - // @see \Drupal\comment\CommentStorageController::updateEntityStatistics(). + // @see \Drupal\comment\CommentStorage::updateEntityStatistics(). \Drupal::state()->set('comment.maintain_entity_statistics', TRUE); } diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 07b177e..fbb2f43 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -988,7 +988,7 @@ function comment_node_update_index(EntityInterface $node, $langcode) { // edit could change the security situation so it is not safe to index the // comments. $index_comments = TRUE; - $roles = \Drupal::entityManager()->getStorageController('user_role')->loadMultiple(); + $roles = \Drupal::entityManager()->getStorage('user_role')->loadMultiple(); $authenticated_can_access = $roles[DRUPAL_AUTHENTICATED_RID]->hasPermission('access comments'); foreach ($roles as $rid => $role) { if ($role->hasPermission('search content') && !$role->hasPermission('access comments')) { diff --git a/core/modules/comment/lib/Drupal/comment/CommentBreadcrumbBuilder.php b/core/modules/comment/lib/Drupal/comment/CommentBreadcrumbBuilder.php index d0d39bb..1c84cfa 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentBreadcrumbBuilder.php +++ b/core/modules/comment/lib/Drupal/comment/CommentBreadcrumbBuilder.php @@ -51,7 +51,7 @@ public function build(array $attributes) { $breadcrumb[] = $this->l($this->t('Home'), ''); $entity = $this->entityManager - ->getStorageController($attributes['entity_type']) + ->getStorage($attributes['entity_type']) ->load($attributes['entity_id']); $uri = $entity->urlInfo(); $breadcrumb[] = \Drupal::l($entity->label(), $uri['route_name'], $uri['route_parameters'], $uri['options']); diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index ef7c7fd..a73ab15 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -87,7 +87,7 @@ protected function init(array &$form_state) { public function form(array $form, array &$form_state) { /** @var \Drupal\comment\CommentInterface $comment */ $comment = $this->entity; - $entity = $this->entityManager->getStorageController($comment->getCommentedEntityTypeId())->load($comment->getCommentedEntityId()); + $entity = $this->entityManager->getStorage($comment->getCommentedEntityTypeId())->load($comment->getCommentedEntityId()); $field_name = $comment->getFieldName(); $instance = $this->fieldInfo->getInstance($entity->getEntityTypeId(), $entity->bundle(), $field_name); @@ -278,7 +278,7 @@ public function validate(array $form, array &$form_state) { if (!empty($form_state['values']['cid'])) { // Verify the name in case it is being changed from being anonymous. - $accounts = $this->entityManager->getStorageController('user')->loadByProperties(array('name' => $form_state['values']['name'])); + $accounts = $this->entityManager->getStorage('user')->loadByProperties(array('name' => $form_state['values']['name'])); $account = reset($accounts); $form_state['values']['uid'] = $account ? $account->id() : 0; @@ -295,7 +295,7 @@ public function validate(array $form, array &$form_state) { // author of this comment was an anonymous user, verify that no registered // user with this name exists. if ($form_state['values']['name']) { - $accounts = $this->entityManager->getStorageController('user')->loadByProperties(array('name' => $form_state['values']['name'])); + $accounts = $this->entityManager->getStorage('user')->loadByProperties(array('name' => $form_state['values']['name'])); if (!empty($accounts)) { $this->setFormError('name', $form_state, $this->t('The name you used belongs to a registered user.')); } diff --git a/core/modules/comment/lib/Drupal/comment/CommentManager.php b/core/modules/comment/lib/Drupal/comment/CommentManager.php index 6976e42..5b1820c 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentManager.php +++ b/core/modules/comment/lib/Drupal/comment/CommentManager.php @@ -101,7 +101,7 @@ public function __construct(FieldInfo $field_info, EntityManagerInterface $entit */ public function getParentEntityUri(CommentInterface $comment) { return $this->entityManager - ->getStorageController($comment->getCommentedEntityTypeId()) + ->getStorage($comment->getCommentedEntityTypeId()) ->load($comment->getCommentedEntityId()) ->urlInfo(); } @@ -143,7 +143,7 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment', // Make sure the field doesn't already exist. if (!$this->fieldInfo->getField($entity_type, $field_name)) { // Add a default comment field for existing node comments. - $field = $this->entityManager->getStorageController('field_config')->create(array( + $field = $this->entityManager->getStorage('field_config')->create(array( 'entity_type' => $entity_type, 'name' => $field_name, 'type' => 'comment', @@ -157,7 +157,7 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment', } // Make sure the instance doesn't already exist. if (!$this->fieldInfo->getInstance($entity_type, $bundle, $field_name)) { - $instance = $this->entityManager->getStorageController('field_instance_config')->create(array( + $instance = $this->entityManager->getStorage('field_instance_config')->create(array( 'label' => 'Comment settings', 'description' => '', 'field_name' => $field_name, @@ -201,9 +201,9 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment', */ public function addBodyField($entity_type, $field_name) { // Create the field if needed. - $field = $this->entityManager->getStorageController('field_config')->load('comment.comment_body'); + $field = $this->entityManager->getStorage('field_config')->load('comment.comment_body'); if (!$field) { - $field = $this->entityManager->getStorageController('field_config')->create(array( + $field = $this->entityManager->getStorage('field_config')->create(array( 'name' => 'comment_body', 'type' => 'text_long', 'entity_type' => 'comment', @@ -213,11 +213,11 @@ public function addBodyField($entity_type, $field_name) { // Create the instance if needed, field name defaults to 'comment'. $comment_bundle = $entity_type . '__' . $field_name; $field_instance = $this->entityManager - ->getStorageController('field_instance_config') + ->getStorage('field_instance_config') ->load("comment.$comment_bundle.comment_body"); if (!$field_instance) { // Attaches the body field by default. - $field_instance = $this->entityManager->getStorageController('field_instance_config')->create(array( + $field_instance = $this->entityManager->getStorage('field_instance_config')->create(array( 'field_name' => 'comment_body', 'label' => 'Comment', 'entity_type' => 'comment', @@ -265,7 +265,7 @@ public function forbiddenMessage(EntityInterface $entity, $field_name) { // We only output a link if we are certain that users will get the // permission to post comments by logging in. $this->authenticatedCanPostComments = $this->entityManager - ->getStorageController('user_role') + ->getStorage('user_role') ->load(DRUPAL_AUTHENTICATED_RID) ->hasPermission('post comments'); } diff --git a/core/modules/comment/lib/Drupal/comment/CommentStorageController.php b/core/modules/comment/lib/Drupal/comment/CommentStorage.php similarity index 94% rename from core/modules/comment/lib/Drupal/comment/CommentStorageController.php rename to core/modules/comment/lib/Drupal/comment/CommentStorage.php index 144b81e..a239fd7 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentStorageController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentStorage.php @@ -2,23 +2,23 @@ /** * @file - * Definition of Drupal\comment\CommentStorageController. + * Definition of Drupal\comment\CommentStorage. */ namespace Drupal\comment; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\Core\Entity\EntityChangedInterface; use Drupal\user\EntityOwnerInterface; /** * Defines the controller class for comments. * - * This extends the Drupal\Core\Entity\DatabaseStorageController class, adding + * This extends the Drupal\Core\Entity\DatabaseEntityStorage class, adding * required special handling for comment entities. */ -class CommentStorageController extends FieldableDatabaseStorageController implements CommentStorageControllerInterface { +class CommentStorage extends FieldableDatabaseEntityStorage implements CommentStorageInterface { /** * {@inheritdoc} diff --git a/core/modules/comment/lib/Drupal/comment/CommentStorageControllerInterface.php b/core/modules/comment/lib/Drupal/comment/CommentStorageInterface.php similarity index 90% rename from core/modules/comment/lib/Drupal/comment/CommentStorageControllerInterface.php rename to core/modules/comment/lib/Drupal/comment/CommentStorageInterface.php index 4583f20..c1587a5 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentStorageControllerInterface.php +++ b/core/modules/comment/lib/Drupal/comment/CommentStorageInterface.php @@ -2,18 +2,18 @@ /** * @file - * Contains \Drupal\comment\CommentStorageControllerInterface. + * Contains \Drupal\comment\CommentStorageInterface. */ namespace Drupal\comment; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines a common interface for comment entity controller classes. */ -interface CommentStorageControllerInterface extends EntityStorageControllerInterface { +interface CommentStorageInterface extends EntityStorageInterface { /** * Get the maximum encoded thread value for the top level comments. diff --git a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php index bd93abb..3661080 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php +++ b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php @@ -98,7 +98,7 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang foreach ($entities as $entity) { $uids[] = $entity->getOwnerId(); } - $this->entityManager->getStorageController('user')->loadMultiple(array_unique($uids)); + $this->entityManager->getStorage('user')->loadMultiple(array_unique($uids)); parent::buildContent($entities, $displays, $view_mode, $langcode); @@ -111,7 +111,7 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang // Load entities in bulk. This is more performant than using // $comment->getCommentedEntity() as we can load them in bulk per type. foreach ($commented_entity_ids as $entity_type => $entity_ids) { - $commented_entities[$entity_type] = $this->entityManager->getStorageController($entity_type)->loadMultiple($entity_ids); + $commented_entities[$entity_type] = $this->entityManager->getStorage($entity_type)->loadMultiple($entity_ids); } foreach ($entities as $entity) { @@ -318,7 +318,7 @@ public static function attachNewCommentsLinkMetadata(array $element, array $cont return $element; } $entity = \Drupal::entityManager() - ->getStorageController($context['entity_type']) + ->getStorage($context['entity_type']) ->load($context['entity_id']); $field_name = $context['field_name']; $query = comment_new_page_count($entity->{$field_name}->comment_count, $new, $entity); diff --git a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php index 7a4115f..0791769 100644 --- a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php +++ b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php @@ -119,7 +119,7 @@ public function commentApprove(CommentInterface $comment) { * The comment listing set to the page on which the comment appears. */ public function commentPermalink(Request $request, CommentInterface $comment) { - if ($entity = $this->entityManager()->getStorageController($comment->getCommentedEntityTypeId())->load($comment->getCommentedEntityId())) { + if ($entity = $this->entityManager()->getStorage($comment->getCommentedEntityTypeId())->load($comment->getCommentedEntityId())) { // Check access permissions for the entity. if (!$entity->access('view')) { throw new AccessDeniedHttpException(); @@ -208,7 +208,7 @@ public function getReplyForm(Request $request, $entity_type, $entity_id, $field_ // Check if entity and field exists. $fields = $this->commentManager->getFields($entity_type); - if (empty($fields[$field_name]) || !($entity = $this->entityManager()->getStorageController($entity_type)->load($entity_id))) { + if (empty($fields[$field_name]) || !($entity = $this->entityManager()->getStorage($entity_type)->load($entity_id))) { throw new NotFoundHttpException(); } @@ -239,7 +239,7 @@ public function getReplyForm(Request $request, $entity_type, $entity_id, $field_ return $this->redirect($uri['route_name'], $uri['route_parameters']); } // Load the parent comment. - $comment = $this->entityManager()->getStorageController('comment')->load($pid); + $comment = $this->entityManager()->getStorage('comment')->load($pid); // Check if the parent comment is published and belongs to the entity. if (!$comment->isPublished() || ($comment->getCommentedEntityId() != $entity->id())) { drupal_set_message($this->t('The comment you are replying to does not exist.'), 'error'); @@ -265,7 +265,7 @@ public function getReplyForm(Request $request, $entity_type, $entity_id, $field_ } // Show the actual reply box. - $comment = $this->entityManager()->getStorageController('comment')->create(array( + $comment = $this->entityManager()->getStorage('comment')->create(array( 'entity_id' => $entity->id(), 'pid' => $pid, 'entity_type' => $entity->getEntityTypeId(), diff --git a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php index 6fd4552..c5e3432 100644 --- a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php @@ -10,7 +10,7 @@ use Drupal\Component\Utility\Number; use Drupal\Core\Entity\ContentEntityBase; use Drupal\comment\CommentInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; use Drupal\Core\Language\Language; @@ -25,7 +25,7 @@ * label = @Translation("Comment"), * bundle_label = @Translation("Content type"), * controllers = { - * "storage" = "Drupal\comment\CommentStorageController", + * "storage" = "Drupal\comment\CommentStorage", * "access" = "Drupal\comment\CommentAccessController", * "view_builder" = "Drupal\comment\CommentViewBuilder", * "form" = { @@ -69,8 +69,8 @@ public function id() { /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { - parent::preSave($storage_controller); + public function preSave(EntityStorageInterface $storage) { + parent::preSave($storage); if (is_null($this->get('status')->value)) { $published = \Drupal::currentUser()->hasPermission('skip comment approval') ? CommentInterface::PUBLISHED : CommentInterface::NOT_PUBLISHED; @@ -89,7 +89,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { if (!$this->hasParentComment()) { // This is a comment with no parent comment (depth 0): we start // by retrieving the maximum thread level. - $max = $storage_controller->getMaxThread($this); + $max = $storage->getMaxThread($this); // Strip the "/" from the end of the thread. $max = rtrim($max, '/'); // We need to get the value at the correct depth. @@ -107,7 +107,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { $parent->setThread((string) rtrim((string) $parent->getThread(), '/')); $prefix = $parent->getThread() . '.'; // Get the max value in *this* thread. - $max = $storage_controller->getMaxThreadPerThread($this); + $max = $storage->getMaxThreadPerThread($this); if ($max == '') { // First child of this parent. As the other two cases do an @@ -147,12 +147,12 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); $this->releaseThreadLock(); // Update the {comment_entity_statistics} table prior to executing the hook. - $storage_controller->updateEntityStatistics($this); + $storage->updateEntityStatistics($this); if ($this->isPublished()) { \Drupal::moduleHandler()->invokeAll('comment_publish', array($this)); } @@ -171,14 +171,14 @@ protected function releaseThreadLock() { /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); - $child_cids = $storage_controller->getChildCids($entities); + $child_cids = $storage->getChildCids($entities); entity_delete_multiple('comment', $child_cids); foreach ($entities as $id => $entity) { - $storage_controller->updateEntityStatistics($entity); + $storage->updateEntityStatistics($entity); } } @@ -503,7 +503,7 @@ public function getChangedTime() { /** * {@inheritdoc} */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { + public static function preCreate(EntityStorageInterface $storage, array &$values) { if (empty($values['field_id']) && !empty($values['field_name']) && !empty($values['entity_type'])) { $values['field_id'] = $values['entity_type'] . '__' . $values['field_name']; } diff --git a/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php b/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php index e2ce52a..9b54bf1 100644 --- a/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php +++ b/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php @@ -8,7 +8,7 @@ namespace Drupal\comment\Form; use Drupal\comment\CommentInterface; -use Drupal\comment\CommentStorageControllerInterface; +use Drupal\comment\CommentStorageInterface; use Drupal\Component\Utility\Unicode; use Drupal\Core\Cache\Cache; use Drupal\Core\Datetime\Date; @@ -32,7 +32,7 @@ class CommentAdminOverview extends FormBase { /** * The comment storage. * - * @var \Drupal\comment\CommentStorageControllerInterface + * @var \Drupal\comment\CommentStorageInterface */ protected $commentStorage; @@ -55,14 +55,14 @@ class CommentAdminOverview extends FormBase { * * @param \Drupal\Core\Entity\EntityManager $entity_manager * The entity manager service. - * @param \Drupal\comment\CommentStorageControllerInterface $comment_storage + * @param \Drupal\comment\CommentStorageInterface $comment_storage * The comment storage. * @param \Drupal\Core\Datetime\Date $date * The date service. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. */ - public function __construct(EntityManager $entity_manager, CommentStorageControllerInterface $comment_storage, Date $date, ModuleHandlerInterface $module_handler) { + public function __construct(EntityManager $entity_manager, CommentStorageInterface $comment_storage, Date $date, ModuleHandlerInterface $module_handler) { $this->entityManager = $entity_manager; $this->commentStorage = $comment_storage; $this->date = $date; @@ -75,7 +75,7 @@ public function __construct(EntityManager $entity_manager, CommentStorageControl public static function create(ContainerInterface $container) { return new static( $container->get('entity.manager'), - $container->get('entity.manager')->getStorageController('comment'), + $container->get('entity.manager')->getStorage('comment'), $container->get('date'), $container->get('module_handler') ); @@ -176,7 +176,7 @@ public function buildForm(array $form, array &$form_state, $type = 'new') { } foreach ($commented_entity_ids as $entity_type => $ids) { - $commented_entities[$entity_type] = $this->entityManager->getStorageController($entity_type)->loadMultiple($ids); + $commented_entities[$entity_type] = $this->entityManager->getStorage($entity_type)->loadMultiple($ids); } foreach ($comments as $comment) { diff --git a/core/modules/comment/lib/Drupal/comment/Form/ConfirmDeleteMultiple.php b/core/modules/comment/lib/Drupal/comment/Form/ConfirmDeleteMultiple.php index 0de4b8b..4598bd0 100644 --- a/core/modules/comment/lib/Drupal/comment/Form/ConfirmDeleteMultiple.php +++ b/core/modules/comment/lib/Drupal/comment/Form/ConfirmDeleteMultiple.php @@ -7,7 +7,7 @@ namespace Drupal\comment\Form; -use Drupal\comment\CommentStorageControllerInterface; +use Drupal\comment\CommentStorageInterface; use Drupal\Component\Utility\String; use Drupal\Core\Cache\Cache; use Drupal\Core\Form\ConfirmFormBase; @@ -21,7 +21,7 @@ class ConfirmDeleteMultiple extends ConfirmFormBase { /** * The comment storage. * - * @var \Drupal\comment\CommentStorageControllerInterface + * @var \Drupal\comment\CommentStorageInterface */ protected $commentStorage; @@ -35,10 +35,10 @@ class ConfirmDeleteMultiple extends ConfirmFormBase { /** * Creates an new ConfirmDeleteMultiple form. * - * @param \Drupal\comment\CommentStorageControllerInterface $comment_storage + * @param \Drupal\comment\CommentStorageInterface $comment_storage * The comment storage. */ - public function __construct(CommentStorageControllerInterface $comment_storage) { + public function __construct(CommentStorageInterface $comment_storage) { $this->commentStorage = $comment_storage; } @@ -47,7 +47,7 @@ public function __construct(CommentStorageControllerInterface $comment_storage) */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('comment') + $container->get('entity.manager')->getStorage('comment') ); } diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php index bf4979b..59b15d3 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php @@ -7,7 +7,7 @@ namespace Drupal\comment\Plugin\Field\FieldFormatter; -use Drupal\comment\CommentStorageControllerInterface; +use Drupal\comment\CommentStorageInterface; use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; use Drupal\Core\Entity\EntityViewBuilderInterface; use Drupal\Core\Field\FieldItemListInterface; @@ -38,11 +38,11 @@ class CommentDefaultFormatter extends FormatterBase implements ContainerFactoryPluginInterface { /** - * The comment storage controller. + * The comment storage. * - * @var \Drupal\comment\CommentStorageControllerInterface + * @var \Drupal\comment\CommentStorageInterface */ - protected $storageController; + protected $storage; /** * The current user. @@ -70,7 +70,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration['label'], $configuration['view_mode'], $container->get('current_user'), - $container->get('entity.manager')->getStorageController('comment'), + $container->get('entity.manager')->getStorage('comment'), $container->get('entity.manager')->getViewBuilder('comment') ); } @@ -92,15 +92,15 @@ public static function create(ContainerInterface $container, array $configuratio * The view mode. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. - * @param \Drupal\comment\CommentStorageControllerInterface $comment_storage_controller - * The comment storage controller. + * @param \Drupal\comment\CommentStorageInterface $comment_storage + * The comment storage. * @param \Drupal\Core\Entity\EntityViewBuilderInterface $comment_view_builder * The comment view builder. */ - public function __construct($plugin_id, array $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, AccountInterface $current_user, CommentStorageControllerInterface $comment_storage_controller, EntityViewBuilderInterface $comment_view_builder) { + public function __construct($plugin_id, array $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, AccountInterface $current_user, CommentStorageInterface $comment_storage, EntityViewBuilderInterface $comment_view_builder) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode); $this->viewBuilder = $comment_view_builder; - $this->storageController = $comment_storage_controller; + $this->storage = $comment_storage; $this->currentUser = $current_user; } @@ -132,7 +132,7 @@ public function viewElements(FieldItemListInterface $items) { $mode = $comment_settings['default_mode']; $comments_per_page = $comment_settings['per_page']; if ($cids = comment_get_thread($entity, $field_name, $mode, $comments_per_page, $this->getSetting('pager_id'))) { - $comments = $this->storageController->loadMultiple($cids); + $comments = $this->storage->loadMultiple($cids); comment_prepare_thread($comments); $build = $this->viewBuilder->viewMultiple($comments); $build['pager']['#theme'] = 'pager'; diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Validation/Constraint/CommentNameConstraintValidator.php b/core/modules/comment/lib/Drupal/comment/Plugin/Validation/Constraint/CommentNameConstraintValidator.php index f1e6c1c..0bb45da 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Validation/Constraint/CommentNameConstraintValidator.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Validation/Constraint/CommentNameConstraintValidator.php @@ -25,7 +25,7 @@ public function validate($field_item, Constraint $constraint) { // taken by a registered user. if ($field_item->getEntity()->getOwnerId() === 0) { // @todo Properly inject dependency https://drupal.org/node/2197029 - $users = \Drupal::entityManager()->getStorageController('user')->loadByProperties(array('name' => $author_name)); + $users = \Drupal::entityManager()->getStorage('user')->loadByProperties(array('name' => $author_name)); if (!empty($users)) { $this->context->addViolation($constraint->message, array('%name' => $author_name)); } diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentValidationTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentValidationTest.php index 56f8a54..006ebe5 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentValidationTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentValidationTest.php @@ -46,26 +46,26 @@ public function setUp() { */ public function testValidation() { // Add comment field to content. - $this->entityManager->getStorageController('field_config')->create(array( + $this->entityManager->getStorage('field_config')->create(array( 'entity_type' => 'node', 'name' => 'comment', 'type' => 'comment', ))->save(); // Add comment field instance to page content. - $this->entityManager->getStorageController('field_instance_config')->create(array( + $this->entityManager->getStorage('field_instance_config')->create(array( 'field_name' => 'comment', 'entity_type' => 'node', 'bundle' => 'page', 'label' => 'Comment settings', ))->save(); - $node = $this->entityManager->getStorageController('node')->create(array( + $node = $this->entityManager->getStorage('node')->create(array( 'type' => 'page', 'title' => 'test', )); $node->save(); - $comment = $this->entityManager->getStorageController('comment')->create(array( + $comment = $this->entityManager->getStorage('comment')->create(array( 'entity_id' => $node->id(), 'entity_type' => 'node', 'field_name' => 'comment', diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php index 5b0e8e6..fad5f36 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/DefaultViewRecentComments.php @@ -8,7 +8,6 @@ namespace Drupal\comment\Tests\Views; use Drupal\comment\CommentInterface; -use Drupal\entity\DatabaseStorageController; use Drupal\views\Views; use Drupal\views\Tests\ViewTestBase; diff --git a/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php b/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php index 1d54be4..5ba7f5e 100644 --- a/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php +++ b/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php @@ -78,9 +78,9 @@ public function testLocks() { ->method('get') ->with('status') ->will($this->returnValue((object) array('value' => NULL))); - $storage_controller = $this->getMock('Drupal\comment\CommentStorageControllerInterface'); - $comment->preSave($storage_controller); - $comment->postSave($storage_controller); + $storage = $this->getMock('Drupal\comment\CommentStorageInterface'); + $comment->preSave($storage); + $comment->postSave($storage); } } diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigSingleExportForm.php b/core/modules/config/lib/Drupal/config/Form/ConfigSingleExportForm.php index c3b505e..101dacb 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigSingleExportForm.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigSingleExportForm.php @@ -166,7 +166,7 @@ protected function findConfiguration($config_type) { ); // For a given entity type, load all entities. if ($config_type && $config_type !== 'system.simple') { - $entity_storage = $this->entityManager->getStorageController($config_type); + $entity_storage = $this->entityManager->getStorage($config_type); foreach ($entity_storage->loadMultiple() as $entity) { $entity_id = $entity->id(); $label = $entity->label() ?: $entity_id; diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigSingleImportForm.php b/core/modules/config/lib/Drupal/config/Form/ConfigSingleImportForm.php index 434745e..b757be6 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigSingleImportForm.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigSingleImportForm.php @@ -181,7 +181,7 @@ public function validateForm(array &$form, array &$form_state) { if ($form_state['values']['config_type'] !== 'system.simple') { $definition = $this->entityManager->getDefinition($form_state['values']['config_type']); $id_key = $definition->getKey('id'); - $entity_storage = $this->entityManager->getStorageController($form_state['values']['config_type']); + $entity_storage = $this->entityManager->getStorage($form_state['values']['config_type']); // If an entity ID was not specified, set an error. if (!isset($data[$id_key])) { $this->setFormError('import', $form_state, $this->t('Missing ID key "@id_key" for this @entity_type import.', array('@id_key' => $id_key, '@entity_type' => $definition->getLabel()))); @@ -233,7 +233,7 @@ public function submitForm(array &$form, array &$form_state) { else { try { $entity = $this->entityManager - ->getStorageController($this->data['config_type']) + ->getStorage($this->data['config_type']) ->create($this->data['import']); $entity->save(); drupal_set_message($this->t('The @entity_type %label was imported.', array('@entity_type' => $entity->getEntityTypeId(), '%label' => $entity->label()))); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigDependencyTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigDependencyTest.php index f35d9f4..0cb93e8 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigDependencyTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigDependencyTest.php @@ -48,7 +48,7 @@ public function testNonEntity() { */ public function testDependencyMangement() { $config_manager = \Drupal::service('config.manager'); - $storage = $this->container->get('entity.manager')->getStorageController('config_test'); + $storage = $this->container->get('entity.manager')->getStorage('config_test'); // Test dependencies between modules. $entity1 = $storage->create( array( @@ -118,7 +118,7 @@ public function testDependencyMangement() { // Create a configuration entity of a different type with the same ID as one // of the entities already created. - $alt_storage = $this->container->get('entity.manager')->getStorageController('config_query_test'); + $alt_storage = $this->container->get('entity.manager')->getStorage('config_query_test'); $alt_storage->create(array('id' => 'entity1', 'test_dependencies' => array('entity' => array($entity1->getConfigDependencyName()))))->save(); $alt_storage->create(array('id' => 'entity2', 'test_dependencies' => array('module' => array('views'))))->save(); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index 710cc0d..33ec8ca 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -9,7 +9,7 @@ use Drupal\simpletest\WebTestBase; use Drupal\config_test\Entity\ConfigTest; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Tests the listing of configuration entities. @@ -37,8 +37,8 @@ public static function getInfo() { function testList() { $controller = \Drupal::entityManager()->getListBuilder('config_test'); - // Test getStorageController() method. - $this->assertTrue($controller->getStorageController() instanceof EntityStorageControllerInterface, 'EntityStorageController instance in storage.'); + // Test getStorage() method. + $this->assertTrue($controller->getStorage() instanceof EntityStorageInterface, 'EntityStorage instance in storage.'); // Get a list of ConfigTest entities and confirm that it contains the // ConfigTest entity provided by the config_test module. @@ -91,20 +91,20 @@ function testList() { $actual_items = $controller->buildRow($entity); $this->assertIdentical($expected_items, $actual_items, 'Return value from buildRow matches expected.'); // Test sorting. - $storage_controller = $controller->getStorageController(); - $entity = $storage_controller->create(array( + $storage = $controller->getStorage(); + $entity = $storage->create(array( 'id' => 'alpha', 'label' => 'Alpha', 'weight' => 1, )); $entity->save(); - $entity = $storage_controller->create(array( + $entity = $storage->create(array( 'id' => 'omega', 'label' => 'Omega', 'weight' => 1, )); $entity->save(); - $entity = $storage_controller->create(array( + $entity = $storage->create(array( 'id' => 'beta', 'label' => 'Beta', 'weight' => 0, diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageTest.php similarity index 92% rename from core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php rename to core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageTest.php index 12a1ede..854882e 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\config\Tests\ConfigEntityStorageControllerTest. + * Contains \Drupal\config\Tests\ConfigEntityStorageTest. */ namespace Drupal\config\Tests; @@ -13,7 +13,7 @@ /** * Tests importing config entity data when the ID or UUID matches existing data. */ -class ConfigEntityStorageControllerTest extends DrupalUnitTestBase { +class ConfigEntityStorageTest extends DrupalUnitTestBase { /** * Modules to enable. diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php index 7ec5e86..9800827 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php @@ -23,9 +23,9 @@ class ConfigEntityUnitTest extends DrupalUnitTestBase { public static $modules = array('config_test'); /** - * The config_test entity storage controller. + * The config_test entity storage. * - * @var \Drupal\Core\Config\Entity\ConfigStorageControllerInterface + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface */ protected $storage; @@ -42,13 +42,13 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); - $this->storage = $this->container->get('entity.manager')->getStorageController('config_test'); + $this->storage = $this->container->get('entity.manager')->getStorage('config_test'); } /** - * Tests storage controller methods. + * Tests storage methods. */ - public function testStorageControllerMethods() { + public function testStorageMethods() { $entity_type = \Drupal::entityManager()->getDefinition('config_test'); $expected = $entity_type->getConfigPrefix() . '.'; diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php index 8bd1b72..718878b 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php @@ -34,7 +34,7 @@ public static function getInfo() { * Tests importing a single configuration file. */ public function testImport() { - $storage = \Drupal::entityManager()->getStorageController('config_test'); + $storage = \Drupal::entityManager()->getStorage('config_test'); $uuid = \Drupal::service('uuid'); $this->drupalLogin($this->drupalCreateUser(array('import configuration'))); @@ -143,7 +143,7 @@ public function testExport() { $this->drupalGet('admin/config/development/configuration/single/export/date_format/fallback'); $this->assertFieldByXPath('//select[@name="config_name"]//option[@selected="selected"]', t('Fallback date format'), 'The fallback date format config entity is selected when specified in the URL.'); - $fallback_date = \Drupal::entityManager()->getStorageController('date_format')->load('fallback'); + $fallback_date = \Drupal::entityManager()->getStorage('date_format')->load('fallback'); $data = \Drupal::service('config.storage')->encode($fallback_date->toArray()); $this->assertFieldByXPath('//textarea[@name="export"]', $data, 'The fallback date format config entity export code is displayed.'); } diff --git a/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php b/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php index d986835..140b50a 100644 --- a/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php +++ b/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php @@ -10,21 +10,21 @@ use Drupal\simpletest\DrupalUnitTestBase; /** - * Base class for testing storage controller operations. + * Base class for testing storage operations. * - * All configuration storage controllers are expected to behave identically in + * All configuration storages are expected to behave identically in * terms of reading, writing, listing, deleting, as well as error handling. * - * Therefore, storage controller tests use a uncommon test case class structure; + * Therefore, storage tests use a uncommon test case class structure; * the base class defines the test method(s) to execute, which are identical for - * all storage controllers. The storage controller specific test case classes + * all storages. The storage specific test case classes * supply the necessary helper methods to interact with the raw/native storage * directly. */ abstract class ConfigStorageTestBase extends DrupalUnitTestBase { /** - * Tests storage controller CRUD operations. + * Tests storage CRUD operations. * * @todo Coverage: Trigger PDOExceptions / Database exceptions. * @todo Coverage: Trigger Yaml's ParseException and DumpException. @@ -162,7 +162,7 @@ function testCRUD() { } /** - * Tests storage controller writing and reading data preserving data type. + * Tests storage writing and reading data preserving data type. */ function testDataTypes() { $name = 'config_test.types'; diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorageController.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorage.php similarity index 67% rename from core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorageController.php rename to core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorage.php index a73cffb..38f769a 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorageController.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestStorage.php @@ -2,21 +2,21 @@ /** * @file - * Contains \Drupal\config_test\ConfigTestStorageController. + * Contains \Drupal\config_test\ConfigTestStorage. */ namespace Drupal\config_test; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\Core\Config\Config; /** * @todo. */ -class ConfigTestStorageController extends ConfigStorageController { +class ConfigTestStorage extends ConfigEntityStorage { /** - * Overrides \Drupal\Core\Config\Entity\ConfigStorageController::importCreate(). + * Overrides \Drupal\Core\Config\Entity\ConfigEntityStorage::importCreate(). */ public function importCreate($name, Config $new_config, Config $old_config) { // Set a global value we can check in test code. @@ -26,7 +26,7 @@ public function importCreate($name, Config $new_config, Config $old_config) { } /** - * Overrides \Drupal\Core\Config\Entity\ConfigStorageController::importUpdate(). + * Overrides \Drupal\Core\Config\Entity\ConfigEntityStorage::importUpdate(). */ public function importUpdate($name, Config $new_config, Config $old_config) { // Set a global value we can check in test code. @@ -36,7 +36,7 @@ public function importUpdate($name, Config $new_config, Config $old_config) { } /** - * Overrides \Drupal\Core\Config\Entity\ConfigStorageController::importDelete(). + * Overrides \Drupal\Core\Config\Entity\ConfigEntityStorage::importDelete(). */ public function importDelete($name, Config $new_config, Config $old_config) { // Set a global value we can check in test code. diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigQueryTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigQueryTest.php index 53cd76d..ef760dd 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigQueryTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigQueryTest.php @@ -14,7 +14,7 @@ * id = "config_query_test", * label = @Translation("Test configuration for query"), * controllers = { - * "storage" = "Drupal\config_test\ConfigTestStorageController", + * "storage" = "Drupal\config_test\ConfigTestStorage", * "list_builder" = "Drupal\Core\Config\Entity\ConfigEntityListBuilder", * "form" = { * "default" = "Drupal\config_test\ConfigTestFormController" diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php index b8d2c56..d5217bf 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php @@ -18,7 +18,7 @@ * id = "config_test", * label = @Translation("Test configuration"), * controllers = { - * "storage" = "Drupal\config_test\ConfigTestStorageController", + * "storage" = "Drupal\config_test\ConfigTestStorage", * "list_builder" = "Drupal\config_test\ConfigTestListBuilder", * "form" = { * "default" = "Drupal\config_test\ConfigTestFormController", diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListBuilder.php b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListBuilder.php index 90d61bb..332f894 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListBuilder.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationBlockListBuilder.php @@ -9,7 +9,7 @@ use Drupal\Component\Utility\String; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Extension\ThemeHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -29,7 +29,7 @@ class ConfigTranslationBlockListBuilder extends ConfigTranslationEntityListBuild /** * {@inheritdoc} */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, ThemeHandlerInterface $theme_handler) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, ThemeHandlerInterface $theme_handler) { parent::__construct($entity_type, $storage); $this->themes = $theme_handler->listInfo(); } @@ -40,7 +40,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('theme_handler') ); } diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListBuilder.php b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListBuilder.php index c2372d9..e58947a 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListBuilder.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Controller/ConfigTranslationFieldInstanceListBuilder.php @@ -11,7 +11,7 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\field\Field; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -56,7 +56,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $entity_manager = $container->get('entity.manager'); return new static( $entity_type, - $entity_manager->getStorageController($entity_type->id()), + $entity_manager->getStorage($entity_type->id()), $entity_manager ); } @@ -66,12 +66,12 @@ public static function createInstance(ContainerInterface $container, EntityTypeI * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, EntityManagerInterface $entity_manager) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, EntityManagerInterface $entity_manager) { parent::__construct($entity_type, $storage); $this->entityManager = $entity_manager; } diff --git a/core/modules/contact/lib/Drupal/contact/Controller/ContactController.php b/core/modules/contact/lib/Drupal/contact/Controller/ContactController.php index bd7bdd7..4c7a58e 100644 --- a/core/modules/contact/lib/Drupal/contact/Controller/ContactController.php +++ b/core/modules/contact/lib/Drupal/contact/Controller/ContactController.php @@ -69,7 +69,7 @@ public function contactSitePage(CategoryInterface $contact_category = NULL) { // Use the default category if no category has been passed. if (empty($contact_category)) { $contact_category = $this->entityManager() - ->getStorageController('contact_category') + ->getStorage('contact_category') ->load($this->config('contact.settings')->get('default_category')); // If there are no categories, do not display the form. if (empty($contact_category)) { @@ -85,7 +85,7 @@ public function contactSitePage(CategoryInterface $contact_category = NULL) { } $message = $this->entityManager() - ->getStorageController('contact_message') + ->getStorage('contact_message') ->create(array( 'category' => $contact_category->id(), )); @@ -110,7 +110,7 @@ public function contactPersonalPage(UserInterface $user) { $this->contactFloodControl(); } - $message = $this->entityManager()->getStorageController('contact_message')->create(array( + $message = $this->entityManager()->getStorage('contact_message')->create(array( 'category' => 'personal', 'recipient' => $user->id(), )); diff --git a/core/modules/contact/lib/Drupal/contact/Entity/Category.php b/core/modules/contact/lib/Drupal/contact/Entity/Category.php index 0fc1d7d..6f0222d 100644 --- a/core/modules/contact/lib/Drupal/contact/Entity/Category.php +++ b/core/modules/contact/lib/Drupal/contact/Entity/Category.php @@ -8,7 +8,7 @@ namespace Drupal\contact\Entity; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\contact\CategoryInterface; /** @@ -79,8 +79,8 @@ class Category extends ConfigEntityBase implements CategoryInterface { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); if (!$update) { entity_invoke_bundle_hook('create', 'contact_message', $this->id()); @@ -93,8 +93,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); foreach ($entities as $entity) { entity_invoke_bundle_hook('delete', 'contact_message', $entity->id()); diff --git a/core/modules/contact/lib/Drupal/contact/Entity/Message.php b/core/modules/contact/lib/Drupal/contact/Entity/Message.php index a3a62cb..5c9e568 100644 --- a/core/modules/contact/lib/Drupal/contact/Entity/Message.php +++ b/core/modules/contact/lib/Drupal/contact/Entity/Message.php @@ -19,7 +19,7 @@ * id = "contact_message", * label = @Translation("Contact message"), * controllers = { - * "storage" = "Drupal\Core\Entity\FieldableNullStorageController", + * "storage" = "Drupal\Core\Entity\FieldableNullStorage", * "view_builder" = "Drupal\contact\MessageViewBuilder", * "form" = { * "default" = "Drupal\contact\MessageFormController" diff --git a/core/modules/contact/lib/Drupal/contact/Tests/MessageEntityTest.php b/core/modules/contact/lib/Drupal/contact/Tests/MessageEntityTest.php index fd5300b..489c5de 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/MessageEntityTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/MessageEntityTest.php @@ -40,7 +40,7 @@ protected function setUp() { * Test some of the methods. */ public function testMessageMethods() { - $message_storage = $this->container->get('entity.manager')->getStorageController('contact_message'); + $message_storage = $this->container->get('entity.manager')->getStorage('contact_message'); $message = $message_storage->create(array('category' => 'feedback')); // Check for empty values first. diff --git a/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactFieldsTest.php b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactFieldsTest.php index 368f1ad..6f23984 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactFieldsTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactFieldsTest.php @@ -7,7 +7,7 @@ namespace Drupal\contact\Tests\Views; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\views\Tests\ViewTestBase; /** @@ -62,7 +62,7 @@ protected function setUp() { public function testViewsData() { // Test that the field is not exposed to views, since contact_message // entities have no storage. - $table_name = FieldableDatabaseStorageController::_fieldTableName($this->field); + $table_name = FieldableDatabaseEntityStorage::_fieldTableName($this->field); $data = $this->container->get('views.views_data')->get($table_name); $this->assertFalse($data, 'The field is not exposed to Views.'); } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/FieldTranslationSynchronizer.php b/core/modules/content_translation/lib/Drupal/content_translation/FieldTranslationSynchronizer.php index 1c8db66..d041976 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/FieldTranslationSynchronizer.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/FieldTranslationSynchronizer.php @@ -48,7 +48,7 @@ public function synchronizeFields(ContentEntityInterface $entity, $sync_langcode // If the entity language is being changed there is nothing to synchronize. $entity_type = $entity->getEntityTypeId(); - $entity_unchanged = isset($entity->original) ? $entity->original : $this->entityManager->getStorageController($entity_type)->loadUnchanged($entity->id()); + $entity_unchanged = isset($entity->original) ? $entity->original : $this->entityManager->getStorage($entity_type)->loadUnchanged($entity->id()); if ($entity->getUntranslated()->language()->id != $entity_unchanged->getUntranslated()->language()->id) { return; } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationTestBase.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationTestBase.php index 09afe8c..d839d48 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationTestBase.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationTestBase.php @@ -7,7 +7,7 @@ namespace Drupal\content_translation\Tests; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\Core\Language\Language; use Drupal\simpletest\WebTestBase; @@ -217,8 +217,8 @@ protected function createEntity($values, $langcode, $bundle_name = NULL) { if ($bundle_key = $entity_type->getKey('bundle')) { $entity_values[$bundle_key] = $bundle_name ?: $this->bundle; } - $controller = $this->container->get('entity.manager')->getStorageController($this->entityTypeId); - if (!($controller instanceof FieldableDatabaseStorageController)) { + $controller = $this->container->get('entity.manager')->getStorage($this->entityTypeId); + if (!($controller instanceof FieldableDatabaseEntityStorage)) { foreach ($values as $property => $value) { if (is_array($value)) { $entity_values[$property] = array($langcode => $value); diff --git a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php index 754ffc0..b5047c0 100644 --- a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php +++ b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php @@ -9,7 +9,7 @@ use Drupal\Core\Datetime\Date; use Drupal\Core\Datetime\DrupalDateTime; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; @@ -40,9 +40,9 @@ class DateTimeDefaultFormatter extends FormatterBase implements ContainerFactory protected $dateService; /** - * The date storage controller. + * The date storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $dateStorage; @@ -63,10 +63,10 @@ class DateTimeDefaultFormatter extends FormatterBase implements ContainerFactory * The view mode. * @param \Drupal\Core\Datetime\Date $date_service * The date service. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $date_storage - * The date storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $date_storage + * The date storage. */ - public function __construct($plugin_id, array $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, Date $date_service, EntityStorageControllerInterface $date_storage) { + public function __construct($plugin_id, array $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, Date $date_service, EntityStorageInterface $date_storage) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode); $this->dateService = $date_service; @@ -85,7 +85,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration['label'], $configuration['view_mode'], $container->get('date'), - $container->get('entity.manager')->getStorageController('date_format') + $container->get('entity.manager')->getStorage('date_format') ); } diff --git a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php index 9389a71..29cd79d 100644 --- a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php +++ b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php @@ -27,7 +27,7 @@ class DateTimeDefaultWidget extends WidgetBase { /** * The date format storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $dateStorage; @@ -38,7 +38,7 @@ public function __construct($plugin_id, array $plugin_definition, FieldDefinitio parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings); // @todo Inject this once https://drupal.org/node/2035317 is in. - $this->dateStorage = \Drupal::entityManager()->getStorageController('date_format'); + $this->dateStorage = \Drupal::entityManager()->getStorage('date_format'); } /** diff --git a/core/modules/edit/lib/Drupal/edit/Access/EditEntityAccessCheck.php b/core/modules/edit/lib/Drupal/edit/Access/EditEntityAccessCheck.php index 3c6dbcd..29c2d27 100644 --- a/core/modules/edit/lib/Drupal/edit/Access/EditEntityAccessCheck.php +++ b/core/modules/edit/lib/Drupal/edit/Access/EditEntityAccessCheck.php @@ -69,7 +69,7 @@ protected function validateAndUpcastRequestAttributes(Request $request) { if (!$entity_type || !$this->entityManager->getDefinition($entity_type)) { return FALSE; } - $entity = $this->entityManager->getStorageController($entity_type)->load($entity_id); + $entity = $this->entityManager->getStorage($entity_type)->load($entity_id); if (!$entity) { return FALSE; } diff --git a/core/modules/edit/lib/Drupal/edit/Access/EditEntityFieldAccessCheck.php b/core/modules/edit/lib/Drupal/edit/Access/EditEntityFieldAccessCheck.php index 50aaf64..01b2868 100644 --- a/core/modules/edit/lib/Drupal/edit/Access/EditEntityFieldAccessCheck.php +++ b/core/modules/edit/lib/Drupal/edit/Access/EditEntityFieldAccessCheck.php @@ -68,7 +68,7 @@ protected function validateAndUpcastRequestAttributes(Request $request) { if (!$entity_type || !$this->entityManager->getDefinition($entity_type)) { return FALSE; } - $entity = $this->entityManager->getStorageController($entity_type)->load($entity_id); + $entity = $this->entityManager->getStorage($entity_type)->load($entity_id); if (!$entity) { return FALSE; } diff --git a/core/modules/edit/lib/Drupal/edit/EditController.php b/core/modules/edit/lib/Drupal/edit/EditController.php index e5d3a87..e618e41 100644 --- a/core/modules/edit/lib/Drupal/edit/EditController.php +++ b/core/modules/edit/lib/Drupal/edit/EditController.php @@ -110,7 +110,7 @@ public function metadata(Request $request) { if (!$entity_type || !$this->entityManager()->getDefinition($entity_type)) { throw new NotFoundHttpException(); } - $entity = $this->entityManager()->getStorageController($entity_type)->load($entity_id); + $entity = $this->entityManager()->getStorage($entity_type)->load($entity_id); if (!$entity) { throw new NotFoundHttpException(); } diff --git a/core/modules/edit/lib/Drupal/edit/Form/EditFieldForm.php b/core/modules/edit/lib/Drupal/edit/Form/EditFieldForm.php index b4f4111..baf74ce 100644 --- a/core/modules/edit/lib/Drupal/edit/Form/EditFieldForm.php +++ b/core/modules/edit/lib/Drupal/edit/Form/EditFieldForm.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityChangedInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormBase; @@ -39,7 +39,7 @@ class EditFieldForm extends FormBase { /** * The node type storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $nodeTypeStorage; @@ -50,10 +50,10 @@ class EditFieldForm extends FormBase { * The tempstore factory. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $node_type_storage + * @param \Drupal\Core\Entity\EntityStorageInterface $node_type_storage * The node type storage. */ - public function __construct(TempStoreFactory $temp_store_factory, ModuleHandlerInterface $module_handler, EntityStorageControllerInterface $node_type_storage) { + public function __construct(TempStoreFactory $temp_store_factory, ModuleHandlerInterface $module_handler, EntityStorageInterface $node_type_storage) { $this->moduleHandler = $module_handler; $this->nodeTypeStorage = $node_type_storage; $this->tempStoreFactory = $temp_store_factory; @@ -66,7 +66,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('user.tempstore'), $container->get('module_handler'), - $container->get('entity.manager')->getStorageController('node_type') + $container->get('entity.manager')->getStorage('node_type') ); } diff --git a/core/modules/edit/tests/Drupal/edit/Tests/Access/EditEntityAccessCheckTest.php b/core/modules/edit/tests/Drupal/edit/Tests/Access/EditEntityAccessCheckTest.php index 9e8d050..bbbf597 100644 --- a/core/modules/edit/tests/Drupal/edit/Tests/Access/EditEntityAccessCheckTest.php +++ b/core/modules/edit/tests/Drupal/edit/Tests/Access/EditEntityAccessCheckTest.php @@ -39,11 +39,11 @@ class EditEntityAccessCheckTest extends UnitTestCase { protected $entityManager; /** - * The mocked entity storage controller. + * The mocked entity storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $entityStorageController; + protected $entityStorage; public static function getInfo() { return array( @@ -56,11 +56,11 @@ public static function getInfo() { protected function setUp() { $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - $this->entityStorageController = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); + $this->entityStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); $this->entityManager->expects($this->any()) - ->method('getStorageController') - ->will($this->returnValue($this->entityStorageController)); + ->method('getStorage') + ->will($this->returnValue($this->entityStorage)); $this->editAccessCheck = new EditEntityAccessCheck($this->entityManager); } @@ -146,7 +146,7 @@ public function testAccessWithNotExistingEntity() { ->with('entity_test') ->will($this->returnValue(array('id' => 'entity_test'))); - $this->entityStorageController->expects($this->once()) + $this->entityStorage->expects($this->once()) ->method('load') ->with(1) ->will($this->returnValue(NULL)); diff --git a/core/modules/edit/tests/Drupal/edit/Tests/Access/EditEntityFieldAccessCheckTest.php b/core/modules/edit/tests/Drupal/edit/Tests/Access/EditEntityFieldAccessCheckTest.php index 1e33123..92d763f 100644 --- a/core/modules/edit/tests/Drupal/edit/Tests/Access/EditEntityFieldAccessCheckTest.php +++ b/core/modules/edit/tests/Drupal/edit/Tests/Access/EditEntityFieldAccessCheckTest.php @@ -41,11 +41,11 @@ class EditEntityFieldAccessCheckTest extends UnitTestCase { protected $entityManager; /** - * The mocked entity storage controller. + * The mocked entity storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $entityStorageController; + protected $entityStorage; public static function getInfo() { return array( @@ -58,11 +58,11 @@ public static function getInfo() { protected function setUp() { $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - $this->entityStorageController = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); + $this->entityStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); $this->entityManager->expects($this->any()) - ->method('getStorageController') - ->will($this->returnValue($this->entityStorageController)); + ->method('getStorage') + ->will($this->returnValue($this->entityStorage)); $this->editAccessCheck = new EditEntityFieldAccessCheck($this->entityManager); } @@ -173,7 +173,7 @@ public function testAccessWithNotExistingEntity() { ->with('entity_test') ->will($this->returnValue(array('id' => 'entity_test'))); - $this->entityStorageController->expects($this->once()) + $this->entityStorage->expects($this->once()) ->method('load') ->with(1) ->will($this->returnValue(NULL)); diff --git a/core/modules/editor/lib/Drupal/editor/EditorController.php b/core/modules/editor/lib/Drupal/editor/EditorController.php index 0e65571..59c1ef9 100644 --- a/core/modules/editor/lib/Drupal/editor/EditorController.php +++ b/core/modules/editor/lib/Drupal/editor/EditorController.php @@ -77,7 +77,7 @@ public function filterXss(Request $request, FilterFormatInterface $filter_format $original_format = NULL; if (isset($original_format_id)) { $original_format = $this->entityManager() - ->getStorageController('filter_format') + ->getStorage('filter_format') ->load($original_format_id); } diff --git a/core/modules/editor/lib/Drupal/editor/Entity/Editor.php b/core/modules/editor/lib/Drupal/editor/Entity/Editor.php index 07dcc4b..82b4ff7 100644 --- a/core/modules/editor/lib/Drupal/editor/Entity/Editor.php +++ b/core/modules/editor/lib/Drupal/editor/Entity/Editor.php @@ -105,7 +105,7 @@ public function calculateDependencies() { */ public function getFilterFormat() { if (!$this->filterFormat) { - $this->filterFormat = \Drupal::entityManager()->getStorageController('filter_format')->load($this->format); + $this->filterFormat = \Drupal::entityManager()->getStorage('filter_format')->load($this->format); } return $this->filterFormat; } diff --git a/core/modules/editor/tests/Drupal/editor/Tests/EditorConfigEntityUnitTest.php b/core/modules/editor/tests/Drupal/editor/Tests/EditorConfigEntityUnitTest.php index 2760e93..9064172 100644 --- a/core/modules/editor/tests/Drupal/editor/Tests/EditorConfigEntityUnitTest.php +++ b/core/modules/editor/tests/Drupal/editor/Tests/EditorConfigEntityUnitTest.php @@ -152,14 +152,14 @@ public function testCalculateDependencies() { ->method('getConfigDependencyName') ->will($this->returnValue('filter.format.test')); - $storage = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); $storage->expects($this->once()) ->method('load') ->with($format_id) ->will($this->returnValue($filter_format)); $this->entityManager->expects($this->once()) - ->method('getStorageController') + ->method('getStorage') ->with('filter_format') ->will($this->returnValue($storage)); diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module index cc22891..d01563b 100644 --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -8,7 +8,7 @@ * entity system. */ -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; /** * Implements hook_help(). @@ -83,7 +83,7 @@ function entity_entity_bundle_rename($entity_type_id, $bundle_old, $bundle_new) if ($bundle_old !== $bundle_new) { $ids = \Drupal::configFactory()->listAll('entity.view_display.' . $entity_type_id . '.' . $bundle_old . '.'); foreach ($ids as $id) { - $id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix()); + $id = ConfigEntityStorage::getIDFromConfigName($id, $entity_type->getConfigPrefix()); $display = entity_load('entity_view_display', $id); $new_id = $entity_type_id . '.' . $bundle_new . '.' . $display->mode; $display->id = $new_id; @@ -97,7 +97,7 @@ function entity_entity_bundle_rename($entity_type_id, $bundle_old, $bundle_new) if ($bundle_old !== $bundle_new) { $ids = \Drupal::configFactory()->listAll('entity.form_display.' . $entity_type_id . '.' . $bundle_old . '.'); foreach ($ids as $id) { - $id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix()); + $id = ConfigEntityStorage::getIDFromConfigName($id, $entity_type->getConfigPrefix()); $form_display = entity_load('entity_form_display', $id); $new_id = $entity_type_id . '.' . $bundle_new . '.' . $form_display->mode; $form_display->id = $new_id; @@ -115,7 +115,7 @@ function entity_entity_bundle_delete($entity_type_id, $bundle) { $entity_type = \Drupal::entityManager()->getDefinition('entity_view_display'); $ids = \Drupal::configFactory()->listAll('entity.view_display.' . $entity_type_id . '.' . $bundle . '.'); foreach ($ids as &$id) { - $id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix()); + $id = ConfigEntityStorage::getIDFromConfigName($id, $entity_type->getConfigPrefix()); } entity_delete_multiple('entity_view_display', $ids); @@ -123,7 +123,7 @@ function entity_entity_bundle_delete($entity_type_id, $bundle) { $entity_type = \Drupal::entityManager()->getDefinition('entity_form_display'); $ids = \Drupal::configFactory()->listAll('entity.form_display.' . $entity_type_id . '.' . $bundle . '.'); foreach ($ids as &$id) { - $id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix()); + $id = ConfigEntityStorage::getIDFromConfigName($id, $entity_type->getConfigPrefix()); } entity_delete_multiple('entity_form_display', $ids); } diff --git a/core/modules/entity/lib/Drupal/entity/Entity/EntityFormDisplay.php b/core/modules/entity/lib/Drupal/entity/Entity/EntityFormDisplay.php index 9e3a6a8..473c7f5 100644 --- a/core/modules/entity/lib/Drupal/entity/Entity/EntityFormDisplay.php +++ b/core/modules/entity/lib/Drupal/entity/Entity/EntityFormDisplay.php @@ -77,7 +77,7 @@ public static function collectRenderDisplay($entity, $form_mode) { ->execute(); // Load the first valid candidate display, if any. - $storage = \Drupal::entityManager()->getStorageController('entity_form_display'); + $storage = \Drupal::entityManager()->getStorage('entity_form_display'); foreach ($candidate_ids as $candidate_id) { if (isset($results[$candidate_id])) { $display = $storage->load($candidate_id); diff --git a/core/modules/entity/lib/Drupal/entity/Entity/EntityFormMode.php b/core/modules/entity/lib/Drupal/entity/Entity/EntityFormMode.php index 4e58485..0cd5b4e 100644 --- a/core/modules/entity/lib/Drupal/entity/Entity/EntityFormMode.php +++ b/core/modules/entity/lib/Drupal/entity/Entity/EntityFormMode.php @@ -31,7 +31,7 @@ * id = "form_mode", * label = @Translation("Form mode"), * controllers = { - * "storage" = "Drupal\entity\EntityDisplayModeStorageController", + * "storage" = "Drupal\entity\EntityDisplayModeStorage", * "list_builder" = "Drupal\entity\EntityFormModeListBuilder", * "form" = { * "add" = "Drupal\entity\Form\EntityFormModeAddForm", diff --git a/core/modules/entity/lib/Drupal/entity/Entity/EntityViewDisplay.php b/core/modules/entity/lib/Drupal/entity/Entity/EntityViewDisplay.php index e4d3880..6af84c9 100644 --- a/core/modules/entity/lib/Drupal/entity/Entity/EntityViewDisplay.php +++ b/core/modules/entity/lib/Drupal/entity/Entity/EntityViewDisplay.php @@ -20,7 +20,7 @@ * id = "entity_view_display", * label = @Translation("Entity view display"), * controllers = { - * "storage" = "Drupal\Core\Config\Entity\ConfigStorageController" + * "storage" = "Drupal\Core\Config\Entity\ConfigEntityStorage" * }, * config_prefix = "view_display", * entity_keys = { @@ -106,7 +106,7 @@ public static function collectRenderDisplays($entities, $view_mode) { } // Load the selected displays. - $storage = \Drupal::entityManager()->getStorageController('entity_view_display'); + $storage = \Drupal::entityManager()->getStorage('entity_view_display'); $displays = $storage->loadMultiple($load_ids); $displays_by_bundle = array(); diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php index 1a2bc5e..79a8b01 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php @@ -8,7 +8,7 @@ namespace Drupal\entity; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Entity\Display\EntityDisplayInterface; use Drupal\field\Field; @@ -141,10 +141,10 @@ public function id() { /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + public function preSave(EntityStorageInterface $storage, $update = TRUE) { // Sort elements by weight before saving. uasort($this->content, 'Drupal\Component\Utility\SortArray::sortByWeightElement'); - parent::preSave($storage_controller, $update); + parent::preSave($storage, $update); } /** @@ -158,7 +158,7 @@ public function calculateDependencies() { if ($bundle_entity_type_id != 'bundle') { // If the target entity type uses entities to manage its bundles then // depend on the bundle entity. - $bundle_entity = \Drupal::entityManager()->getStorageController($bundle_entity_type_id)->load($this->bundle); + $bundle_entity = \Drupal::entityManager()->getStorage($bundle_entity_type_id)->load($this->bundle); $this->addDependency('entity', $bundle_entity->getConfigDependencyName()); } // Create dependencies on both hidden and visible fields. @@ -177,7 +177,7 @@ public function calculateDependencies() { } // Depend on configured modes. if ($this->mode != 'default') { - $mode_entity = \Drupal::entityManager()->getStorageController($this->displayContext . '_mode')->load($target_entity_type->id() . '.' . $this->mode); + $mode_entity = \Drupal::entityManager()->getStorage($this->displayContext . '_mode')->load($target_entity_type->id() . '.' . $this->mode); $this->addDependency('entity', $mode_entity->getConfigDependencyName()); } return $this->dependencies; @@ -186,7 +186,7 @@ public function calculateDependencies() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + public function postSave(EntityStorageInterface $storage, $update = TRUE) { // Reset the render cache for the target entity type. if (\Drupal::entityManager()->hasController($this->targetEntityType, 'view_builder')) { \Drupal::entityManager()->getViewBuilder($this->targetEntityType)->resetCache(); diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php index 67f4a2d..05c241a 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php @@ -9,7 +9,7 @@ use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -32,12 +32,12 @@ class EntityDisplayModeListBuilder extends ConfigEntityListBuilder { * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. * @param \Drupal\Core\Entity\EntityTypeInterface[] $entity_types * List of all entity types. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, array $entity_types) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, array $entity_types) { parent::__construct($entity_type, $storage); $this->entityTypes = $entity_types; @@ -50,7 +50,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $entity_manager = $container->get('entity.manager'); return new static( $entity_type, - $entity_manager->getStorageController($entity_type->id()), + $entity_manager->getStorage($entity_type->id()), $entity_manager->getDefinitions() ); } diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeStorageController.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeStorage.php similarity index 56% rename from core/modules/entity/lib/Drupal/entity/EntityDisplayModeStorageController.php rename to core/modules/entity/lib/Drupal/entity/EntityDisplayModeStorage.php index cca791e..62c41c1 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeStorageController.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeStorage.php @@ -2,18 +2,18 @@ /** * @file - * Contains \Drupal\entity\EntityDisplayModeStorageController. + * Contains \Drupal\entity\EntityDisplayModeStorage. */ namespace Drupal\entity; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\Core\Entity\EntityInterface; /** - * Defines the storage controller class for entity form and view modes. + * Defines the storage class for entity form and view modes. */ -class EntityDisplayModeStorageController extends ConfigStorageController { +class EntityDisplayModeStorage extends ConfigEntityStorage { /** * {@inheritdoc} diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php b/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php index c1d6114..4c1624a 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php @@ -77,7 +77,7 @@ public function getMatches($field, $instance, $entity_type, $entity_id = '', $pr $entity = NULL; if ($entity_id !== 'NULL') { - $entity = $this->entityManager->getStorageController($entity_type)->load($entity_id); + $entity = $this->entityManager->getStorage($entity_type)->load($entity_id); if (!$entity || !$entity->access('view')) { throw new AccessDeniedHttpException(); } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php index 3b95917..93a724a 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldType/ConfigurableEntityReferenceFieldItemList.php @@ -38,7 +38,7 @@ protected function getDefaultValue() { ->condition('uuid', $uuids, 'IN') ->execute(); $entities = \Drupal::entityManager() - ->getStorageController($target_type) + ->getStorage($target_type) ->loadMultiple($entity_ids); foreach ($entities as $id => $entity) { @@ -80,7 +80,7 @@ public function defaultValuesFormSubmit(array $element, array &$form, array &$fo $ids[] = $properties['target_id']; } $entities = \Drupal::entityManager() - ->getStorageController($this->getSetting('target_type')) + ->getStorage($this->getSetting('target_type')) ->loadMultiple($ids); foreach ($default_value as $delta => $properties) { diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php index 66849a7..2ed1dfe 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldWidget/AutocompleteWidgetBase.php @@ -184,7 +184,7 @@ protected function createNewEntity($label, $uid) { $bundle_key = $entity_type->getKey('bundle'); $label_key = $entity_type->getKey('label'); - $entity = $entity_manager->getStorageController($target_type)->create(array( + $entity = $entity_manager->getStorage($target_type)->create(array( $label_key => $label, $bundle_key => $bundle, )); diff --git a/core/modules/field/field.module b/core/modules/field/field.module index f0e280c..12e5879 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -48,7 +48,7 @@ * type 'image'. The administrator (again, via a UI) creates two Field * Instances, one attaching the field 'subtitle' to the 'node' bundle 'article' * and one attaching the field 'photo' to the 'node' bundle 'article'. When the - * node storage controller loads an Article node, it loads the values of the + * node storage loads an Article node, it loads the values of the * 'subtitle' and 'photo' fields because they are both attached to the 'node' * bundle 'article'. * diff --git a/core/modules/field/field.purge.inc b/core/modules/field/field.purge.inc index 78b589d..212c2b5 100644 --- a/core/modules/field/field.purge.inc +++ b/core/modules/field/field.purge.inc @@ -17,7 +17,7 @@ * entities as well as deleting entire fields or field instances in a single * operation. * - * When a single entity is deleted, the Entity storage controller performs the + * When a single entity is deleted, the Entity storage performs the * following operations: * - Invoking the FieldItemListInterface delete() method for each field on the * entity. A file field type might use this method to delete uploaded files @@ -103,7 +103,7 @@ function field_purge_batch($batch_size) { $ids->revision_id = $revision_id; $ids->entity_id = $entity_id; $entity = _field_create_entity_from_ids($ids); - \Drupal::entityManager()->getStorageController($entity_type)->onFieldItemsPurge($entity, $instance); + \Drupal::entityManager()->getStorage($entity_type)->onFieldItemsPurge($entity, $instance); } } else { @@ -174,7 +174,7 @@ function field_purge_field($field) { $state->set('field.field.deleted', $deleted_fields); // Notify the storage layer. - \Drupal::entityManager()->getStorageController($field->entity_type)->onFieldPurge($field); + \Drupal::entityManager()->getStorage($field->entity_type)->onFieldPurge($field); // Clear the cache. field_info_cache_clear(); diff --git a/core/modules/field/field.views.inc b/core/modules/field/field.views.inc index 885134b..508b0ee 100644 --- a/core/modules/field/field.views.inc +++ b/core/modules/field/field.views.inc @@ -6,8 +6,8 @@ */ use Drupal\Component\Utility\NestedArray; -use Drupal\Core\Entity\FieldableDatabaseStorageController; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\field\FieldConfigInterface; /** @@ -63,11 +63,11 @@ function field_views_data_alter(&$data) { * The field definition. * * @return bool - * True if the entity type uses DatabaseStorageController. + * True if the entity type uses DatabaseEntityStorage. */ function _field_views_is_sql_entity_type(FieldConfigInterface $field) { $entity_manager = \Drupal::entityManager(); - if ($entity_manager->getDefinition($field->entity_type) && $entity_manager->getStorageController($field->entity_type) instanceof FieldableDatabaseStorageController) { + if ($entity_manager->getDefinition($field->entity_type) && $entity_manager->getStorage($field->entity_type) instanceof FieldableDatabaseEntityStorage) { return TRUE; } } @@ -139,20 +139,20 @@ function field_views_field_default_views_data(FieldConfigInterface $field) { // Description of the field tables. $field_tables = array( - EntityStorageControllerInterface::FIELD_LOAD_CURRENT => array( - 'table' => FieldableDatabaseStorageController::_fieldTableName($field), + EntityStorageInterface::FIELD_LOAD_CURRENT => array( + 'table' => FieldableDatabaseEntityStorage::_fieldTableName($field), 'alias' => "{$entity_type_id}__{$field_name}", ), ); if ($supports_revisions) { - $field_tables[EntityStorageControllerInterface::FIELD_LOAD_REVISION] = array( - 'table' => FieldableDatabaseStorageController::_fieldRevisionTableName($field), + $field_tables[EntityStorageInterface::FIELD_LOAD_REVISION] = array( + 'table' => FieldableDatabaseEntityStorage::_fieldRevisionTableName($field), 'alias' => "{$entity_type_id}_revision__{$field_name}", ); } // Build the relationships between the field table and the entity tables. - $table_alias = $field_tables[EntityStorageControllerInterface::FIELD_LOAD_CURRENT]['alias']; + $table_alias = $field_tables[EntityStorageInterface::FIELD_LOAD_CURRENT]['alias']; $data[$table_alias]['table']['join'][$entity_table] = array( 'left_field' => $entity_type->getKey('id'), 'field' => 'entity_id', @@ -161,7 +161,7 @@ function field_views_field_default_views_data(FieldConfigInterface $field) { ), ); if ($supports_revisions) { - $table_alias = $field_tables[EntityStorageControllerInterface::FIELD_LOAD_REVISION]['alias']; + $table_alias = $field_tables[EntityStorageInterface::FIELD_LOAD_REVISION]['alias']; $data[$table_alias]['table']['join'][$entity_revision_table] = array( 'left_field' => $entity_type->getKey('revision'), 'field' => 'revision_id', @@ -177,7 +177,7 @@ function field_views_field_default_views_data(FieldConfigInterface $field) { // Build the list of additional fields to add to queries. $add_fields = array('delta', 'langcode', 'bundle'); foreach (array_keys($field_columns) as $column) { - $add_fields[] = FieldableDatabaseStorageController::_fieldColumnName($field, $column); + $add_fields[] = FieldableDatabaseEntityStorage::_fieldColumnName($field, $column); } // Determine the label to use for the field. We don't have a label available // at the field level, so we just go through all instances and take the one @@ -189,7 +189,7 @@ function field_views_field_default_views_data(FieldConfigInterface $field) { $table = $table_info['table']; $table_alias = $table_info['alias']; - if ($type == EntityStorageControllerInterface::FIELD_LOAD_CURRENT) { + if ($type == EntityStorageInterface::FIELD_LOAD_CURRENT) { $group = $group_name; $field_alias = $field_name; } @@ -210,7 +210,7 @@ function field_views_field_default_views_data(FieldConfigInterface $field) { $aliases = array(); $also_known = array(); foreach ($all_labels as $label_name => $true) { - if ($type == EntityStorageControllerInterface::FIELD_LOAD_CURRENT) { + if ($type == EntityStorageInterface::FIELD_LOAD_CURRENT) { if ($label != $label_name) { $aliases[] = array( 'base' => $entity_table, @@ -249,7 +249,7 @@ function field_views_field_default_views_data(FieldConfigInterface $field) { 'entity_tables' => $entity_tables, // Default the element type to div, let the UI change it if necessary. 'element type' => 'div', - 'is revision' => $type == EntityStorageControllerInterface::FIELD_LOAD_REVISION, + 'is revision' => $type == EntityStorageInterface::FIELD_LOAD_REVISION, ); } @@ -295,16 +295,16 @@ function field_views_field_default_views_data(FieldConfigInterface $field) { $table = $table_info['table']; $table_alias = $table_info['alias']; - if ($type == EntityStorageControllerInterface::FIELD_LOAD_CURRENT) { + if ($type == EntityStorageInterface::FIELD_LOAD_CURRENT) { $group = $group_name; } else { $group = t('@group (historical data)', array('@group' => $group_name)); } - $column_real_name = FieldableDatabaseStorageController::_fieldColumnName($field, $column); + $column_real_name = FieldableDatabaseEntityStorage::_fieldColumnName($field, $column); // Load all the fields from the table by default. - $field_sql_schema = FieldableDatabaseStorageController::_fieldSqlSchema($field); + $field_sql_schema = FieldableDatabaseEntityStorage::_fieldSqlSchema($field); $additional_fields = array_keys($field_sql_schema[$table]['fields']); $data[$table_alias][$column_real_name] = array( diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php index 20ff0de..e639c5f 100644 --- a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php +++ b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php @@ -10,7 +10,7 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldDefinition; use Drupal\Core\Field\TypedData\FieldItemDataDefinition; use Drupal\field\FieldException; @@ -23,7 +23,7 @@ * id = "field_config", * label = @Translation("Field"), * controllers = { - * "storage" = "Drupal\field\FieldConfigStorageController" + * "storage" = "Drupal\field\FieldConfigStorage" * }, * config_prefix = "field", * entity_keys = { @@ -269,15 +269,15 @@ public function toArray() { * @throws \Drupal\Core\Entity\EntityStorageException * In case of failures at the configuration storage level. */ - public function preSave(EntityStorageControllerInterface $storage_controller) { + public function preSave(EntityStorageInterface $storage) { // Clear the derived data about the field. unset($this->schema); if ($this->isNew()) { - $this->preSaveNew($storage_controller); + $this->preSaveNew($storage); } else { - $this->preSaveUpdated($storage_controller); + $this->preSaveUpdated($storage); } if (!$this->isSyncing()) { // Ensure the correct dependencies are present. @@ -288,12 +288,12 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { /** * Prepares saving a new field definition. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The entity storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage. * * @throws \Drupal\field\FieldException If the field definition is invalid. */ - protected function preSaveNew(EntityStorageControllerInterface $storage_controller) { + protected function preSaveNew(EntityStorageInterface $storage) { $entity_manager = \Drupal::entityManager(); // Assign the ID. @@ -328,8 +328,8 @@ protected function preSaveNew(EntityStorageControllerInterface $storage_controll // definition is passed to the various hooks and written to config. $this->settings += $field_type['settings']; - // Notify the entity storage controller. - $entity_manager->getStorageController($this->entity_type)->onFieldCreate($this); + // Notify the entity storage. + $entity_manager->getStorage($this->entity_type)->onFieldCreate($this); } /** @@ -345,10 +345,10 @@ public function calculateDependencies() { /** * Prepares saving an updated field definition. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The entity storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage. */ - protected function preSaveUpdated(EntityStorageControllerInterface $storage_controller) { + protected function preSaveUpdated(EntityStorageInterface $storage) { $module_handler = \Drupal::moduleHandler(); $entity_manager = \Drupal::entityManager(); $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); @@ -369,16 +369,16 @@ protected function preSaveUpdated(EntityStorageControllerInterface $storage_cont // invokes hook_field_config_update_forbid(). $module_handler->invokeAll('field_config_update_forbid', array($this, $this->original)); - // Notify the storage controller. The controller can reject the definition + // Notify the storage. The controller can reject the definition // update as invalid by raising an exception, which stops execution before // the definition is written to config. - $entity_manager->getStorageController($this->entity_type)->onFieldUpdate($this); + $entity_manager->getStorage($this->entity_type)->onFieldUpdate($this); } /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + public function postSave(EntityStorageInterface $storage, $update = TRUE) { // Clear the cache. field_cache_clear(); @@ -395,9 +395,9 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $fields) { + public static function preDelete(EntityStorageInterface $storage, array $fields) { $state = \Drupal::state(); - $instance_controller = \Drupal::entityManager()->getStorageController('field_instance_config'); + $instance_storage = \Drupal::entityManager()->getStorage('field_instance_config'); // Delete instances first. Note: when deleting a field through // FieldInstanceConfig::postDelete(), the instances have been deleted already, so @@ -411,12 +411,12 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr } } if ($instance_ids) { - $instances = $instance_controller->loadMultiple($instance_ids); + $instances = $instance_storage->loadMultiple($instance_ids); // Tag the objects to preserve recursive deletion of the field. foreach ($instances as $instance) { $instance->noFieldDelete = TRUE; } - $instance_controller->delete($instances); + $instance_storage->delete($instances); } // Keep the field definitions in the state storage so we can use them later @@ -437,11 +437,11 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $fields) { + public static function postDelete(EntityStorageInterface $storage, array $fields) { // Notify the storage. foreach ($fields as $field) { if (!$field->deleted) { - \Drupal::entityManager()->getStorageController($field->entity_type)->onFieldDelete($field); + \Drupal::entityManager()->getStorage($field->entity_type)->onFieldDelete($field); } } diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php index 2b8e87f..94dc562 100644 --- a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php +++ b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php @@ -9,7 +9,7 @@ use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldDefinition; use Drupal\Core\Field\TypedData\FieldItemDataDefinition; use Drupal\field\Field; @@ -23,7 +23,7 @@ * id = "field_instance_config", * label = @Translation("Field instance"), * controllers = { - * "storage" = "Drupal\field\FieldInstanceConfigStorageController" + * "storage" = "Drupal\field\FieldInstanceConfigStorage" * }, * config_prefix = "instance", * entity_keys = { @@ -329,15 +329,15 @@ public function toArray() { * @throws \Drupal\Core\Entity\EntityStorageException * In case of failures at the configuration storage level. */ - public function preSave(EntityStorageControllerInterface $storage_controller) { + public function preSave(EntityStorageInterface $storage) { $entity_manager = \Drupal::entityManager(); $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); if ($this->isNew()) { // Set the default instance settings. $this->settings += $field_type_manager->getDefaultInstanceSettings($this->field->type); - // Notify the entity storage controller. - $entity_manager->getStorageController($this->entity_type)->onInstanceCreate($this); + // Notify the entity storage. + $entity_manager->getStorage($this->entity_type)->onInstanceCreate($this); } else { // Some updates are always disallowed. @@ -352,8 +352,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { } // Set the default instance settings. $this->settings += $field_type_manager->getDefaultInstanceSettings($this->field->type); - // Notify the entity storage controller. - $entity_manager->getStorageController($this->entity_type)->onInstanceUpdate($this); + // Notify the entity storage. + $entity_manager->getStorage($this->entity_type)->onInstanceUpdate($this); } if (!$this->isSyncing()) { // Ensure the correct dependencies are present. @@ -374,7 +374,7 @@ public function calculateDependencies() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { + public function postSave(EntityStorageInterface $storage, $update = TRUE) { // Clear the cache. field_cache_clear(); @@ -389,7 +389,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $instances) { + public static function preDelete(EntityStorageInterface $storage, array $instances) { $state = \Drupal::state(); // Keep the instance definitions in the state storage so we can use them @@ -408,16 +408,16 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $instances) { - $field_controller = \Drupal::entityManager()->getStorageController('field_config'); + public static function postDelete(EntityStorageInterface $storage, array $instances) { + $field_storage = \Drupal::entityManager()->getStorage('field_config'); // Clear the cache upfront, to refresh the results of getBundles(). field_cache_clear(); - // Notify the entity storage controller. + // Notify the entity storage. foreach ($instances as $instance) { if (!$instance->deleted) { - \Drupal::entityManager()->getStorageController($instance->entity_type)->onInstanceDelete($instance); + \Drupal::entityManager()->getStorage($instance->entity_type)->onInstanceDelete($instance); } } @@ -431,7 +431,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont } } if ($fields_to_delete) { - $field_controller->delete($fields_to_delete); + $field_storage->delete($fields_to_delete); } // Cleanup entity displays. diff --git a/core/modules/field/lib/Drupal/field/FieldConfigStorageController.php b/core/modules/field/lib/Drupal/field/FieldConfigStorage.php similarity index 88% rename from core/modules/field/lib/Drupal/field/FieldConfigStorageController.php rename to core/modules/field/lib/Drupal/field/FieldConfigStorage.php index 7fb0866..ba1803a 100644 --- a/core/modules/field/lib/Drupal/field/FieldConfigStorageController.php +++ b/core/modules/field/lib/Drupal/field/FieldConfigStorage.php @@ -2,14 +2,14 @@ /** * @file - * Contains \Drupal\field\FieldConfigStorageController. + * Contains \Drupal\field\FieldConfigStorage. */ namespace Drupal\field; use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Config\Config; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Query\QueryFactory; @@ -22,7 +22,7 @@ /** * Controller class for fields. */ -class FieldConfigStorageController extends ConfigStorageController { +class FieldConfigStorage extends ConfigEntityStorage { /** * The module handler. @@ -46,7 +46,7 @@ class FieldConfigStorageController extends ConfigStorageController { protected $state; /** - * Constructs a FieldConfigStorageController object. + * Constructs a FieldConfigStorage object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -97,18 +97,18 @@ public function loadByProperties(array $conditions = array()) { if (isset($conditions['entity_type']) && isset($conditions['field_name'])) { // Optimize for the most frequent case where we do have a specific ID. $id = $conditions['entity_type'] . $conditions['field_name']; - $fields = $this->entityManager->getStorageController($this->entityTypeId)->loadMultiple(array($id)); + $fields = $this->entityManager->getStorage($this->entityTypeId)->loadMultiple(array($id)); } else { // No specific ID, we need to examine all existing fields. - $fields = $this->entityManager->getStorageController($this->entityTypeId)->loadMultiple(); + $fields = $this->entityManager->getStorage($this->entityTypeId)->loadMultiple(); } // Merge deleted fields (stored in state) if needed. if ($include_deleted) { $deleted_fields = $this->state->get('field.field.deleted') ?: array(); foreach ($deleted_fields as $id => $config) { - $fields[$id] = $this->entityManager->getStorageController($this->entityTypeId)->create($config); + $fields[$id] = $this->entityManager->getStorage($this->entityTypeId)->create($config); } } diff --git a/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorageController.php b/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorage.php similarity index 89% rename from core/modules/field/lib/Drupal/field/FieldInstanceConfigStorageController.php rename to core/modules/field/lib/Drupal/field/FieldInstanceConfigStorage.php index d18fbf3..1942ef5 100644 --- a/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorageController.php +++ b/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorage.php @@ -2,13 +2,13 @@ /** * @file - * Contains \Drupal\field\FieldInstanceConfigStorageController. + * Contains \Drupal\field\FieldInstanceConfigStorage. */ namespace Drupal\field; use Drupal\Core\Config\Config; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Query\QueryFactory; @@ -27,7 +27,7 @@ * (field.field.* entries are processed before field.instance.* entries). * @todo Revisit after http://drupal.org/node/1944368. */ -class FieldInstanceConfigStorageController extends ConfigStorageController { +class FieldInstanceConfigStorage extends ConfigEntityStorage { /** * The entity manager. @@ -44,7 +44,7 @@ class FieldInstanceConfigStorageController extends ConfigStorageController { protected $state; /** - * Constructs a FieldInstanceConfigStorageController object. + * Constructs a FieldInstanceConfigStorage object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -104,18 +104,18 @@ public function loadByProperties(array $conditions = array()) { if (isset($conditions['entity_type']) && isset($conditions['bundle']) && isset($conditions['field_name'])) { // Optimize for the most frequent case where we do have a specific ID. $id = $conditions['entity_type'] . '.' . $conditions['bundle'] . '.' . $conditions['field_name']; - $instances = $this->entityManager->getStorageController($this->entityTypeId)->loadMultiple(array($id)); + $instances = $this->entityManager->getStorage($this->entityTypeId)->loadMultiple(array($id)); } else { // No specific ID, we need to examine all existing instances. - $instances = $this->entityManager->getStorageController($this->entityTypeId)->loadMultiple(); + $instances = $this->entityManager->getStorage($this->entityTypeId)->loadMultiple(); } // Merge deleted instances (stored in state) if needed. if ($include_deleted) { $deleted_instances = $this->state->get('field.instance.deleted') ?: array(); foreach ($deleted_instances as $id => $config) { - $instances[$id] = $this->entityManager->getStorageController($this->entityTypeId)->create($config); + $instances[$id] = $this->entityManager->getStorage($this->entityTypeId)->create($config); } } diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php index be3734d..94e352d 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php @@ -9,9 +9,9 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\field\Field as FieldHelper; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FormatterPluginManager; use Drupal\Core\Language\Language; @@ -228,7 +228,7 @@ public function query($use_groupby = FALSE) { $options += is_array($this->options['group_columns']) ? $this->options['group_columns'] : array(); $fields = array(); - $rkey = $this->definition['is revision'] ? EntityStorageControllerInterface::FIELD_LOAD_REVISION : EntityStorageControllerInterface::FIELD_LOAD_CURRENT; + $rkey = $this->definition['is revision'] ? EntityStorageInterface::FIELD_LOAD_REVISION : EntityStorageInterface::FIELD_LOAD_CURRENT; // Go through the list and determine the actual column name from field api. foreach ($options as $column) { $name = $column; @@ -309,7 +309,7 @@ public function clickSort($order) { $this->ensureMyTable(); $field = field_info_field($this->definition['entity_type'], $this->definition['field_name']); - $column = FieldableDatabaseStorageController::_fieldColumnName($field, $this->options['click_sort_column']); + $column = FieldableDatabaseEntityStorage::_fieldColumnName($field, $this->options['click_sort_column']); if (!isset($this->aliases[$column])) { // Column is not in query; add a sort on it (without adding the column). $this->aliases[$column] = $this->tableAlias . '.' . $column; diff --git a/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php b/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php index caac10c..90cc6fa 100644 --- a/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php @@ -7,7 +7,7 @@ namespace Drupal\field\Tests; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\Core\Entity\EntityInterface; use Drupal\field\FieldConfigInterface; @@ -186,9 +186,9 @@ function testDeleteFieldInstance() { $this->assertEqual($instance->bundle, $bundle, 'The deleted instance is for the correct bundle'); // Check that the actual stored content did not change during delete. - $schema = FieldableDatabaseStorageController::_fieldSqlSchema($field); - $table = FieldableDatabaseStorageController::_fieldTableName($field); - $column = FieldableDatabaseStorageController::_fieldColumnName($field, 'value'); + $schema = FieldableDatabaseEntityStorage::_fieldSqlSchema($field); + $table = FieldableDatabaseEntityStorage::_fieldTableName($field); + $column = FieldableDatabaseEntityStorage::_fieldColumnName($field, 'value'); $result = db_select($table, 't') ->fields('t', array_keys($schema[$table]['fields'])) ->execute(); diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php index 1c0518e..98bbb73 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php @@ -217,7 +217,7 @@ function testFieldAttachCache() { $this->assertFalse(\Drupal::cache('field')->get($cid), 'Cached: no cache entry on insert'); // Load, and check that a cache entry is present with the expected values. - $controller = $this->container->get('entity.manager')->getStorageController($entity->getEntityTypeId()); + $controller = $this->container->get('entity.manager')->getStorage($entity->getEntityTypeId()); $controller->resetCache(); $controller->load($entity->id()); $cache = \Drupal::cache('field')->get($cid); diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php index a981a18..4b0e85e 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php @@ -70,9 +70,9 @@ function testFieldAttachSaveLoad() { $values[$current_revision] = $current_values; } - $storage_controller = $this->container->get('entity.manager')->getStorageController($entity_type); - $storage_controller->resetCache(); - $entity = $storage_controller->load($entity_id); + $storage = $this->container->get('entity.manager')->getStorage($entity_type); + $storage->resetCache(); + $entity = $storage->load($entity_id); // Confirm current revision loads the correct data. // Number of values per field loaded equals the field cardinality. $this->assertEqual(count($entity->{$this->field_name}), $cardinality, 'Current revision: expected number of values'); @@ -87,7 +87,7 @@ function testFieldAttachSaveLoad() { // Confirm each revision loads the correct data. foreach (array_keys($values) as $revision_id) { - $entity = $storage_controller->loadRevision($revision_id); + $entity = $storage->loadRevision($revision_id); // Number of values per field loaded equals the field cardinality. $this->assertEqual(count($entity->{$this->field_name}), $cardinality, format_string('Revision %revision_id: expected number of values.', array('%revision_id' => $revision_id))); for ($delta = 0; $delta < $cardinality; $delta++) { @@ -156,7 +156,7 @@ function testFieldAttachLoadMultiple() { } // Check that a single load correctly loads field values for both entities. - $controller = \Drupal::entityManager()->getStorageController($entity->getEntityTypeId()); + $controller = \Drupal::entityManager()->getStorage($entity->getEntityTypeId()); $controller->resetCache(); $entities = $controller->loadMultiple(); foreach ($entities as $index => $entity) { @@ -267,7 +267,7 @@ function testFieldAttachDelete() { $entity->setNewRevision(); $entity->save(); $vids[] = $entity->getRevisionId(); - $controller = $this->container->get('entity.manager')->getStorageController($entity->getEntityTypeId()); + $controller = $this->container->get('entity.manager')->getStorage($entity->getEntityTypeId()); $controller->resetCache(); // Confirm each revision loads @@ -334,7 +334,7 @@ function testEntityCreateRenameBundle() { $this->assertIdentical($this->instance->bundle, $new_bundle, "Bundle name has been updated in the instance."); // Verify the field data is present on load. - $controller = $this->container->get('entity.manager')->getStorageController($entity->getEntityTypeId()); + $controller = $this->container->get('entity.manager')->getStorage($entity->getEntityTypeId()); $controller->resetCache(); $entity = $controller->load($entity->id()); $this->assertEqual(count($entity->{$this->field_name}), $cardinality, "Bundle name has been updated in the field storage"); @@ -389,7 +389,7 @@ function testEntityDeleteBundle() { entity_test_delete_bundle($this->instance->bundle, $entity_type); // Verify no data gets loaded - $controller = $this->container->get('entity.manager')->getStorageController($entity->getEntityTypeId()); + $controller = $this->container->get('entity.manager')->getStorage($entity->getEntityTypeId()); $controller->resetCache(); $entity= $controller->load($entity->id()); diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php index 1f73528..5549e1a 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php @@ -212,8 +212,8 @@ function testDeleteFieldInstanceCrossDeletion() { $instance->save(); $instance_2 = entity_create('field_instance_config', $instance_definition_2); $instance_2->save(); - $instance_controller = $this->container->get('entity.manager')->getStorageController('field_instance_config'); - $instance_controller->delete(array($instance, $instance_2)); + $instance_storage = $this->container->get('entity.manager')->getStorage('field_instance_config'); + $instance_storage->delete(array($instance, $instance_2)); $this->assertFalse(field_info_field('entity_test', $field->name)); } diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php b/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php index 9e10afd..cf43966 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php @@ -109,7 +109,7 @@ function createFieldWithInstance($suffix = '', $entity_type = 'entity_test', $bu */ protected function entitySaveReload(EntityInterface $entity) { $entity->save(); - $controller = $this->container->get('entity.manager')->getStorageController($entity->getEntityTypeId()); + $controller = $this->container->get('entity.manager')->getStorage($entity->getEntityTypeId()); $controller->resetCache(); return $controller->load($entity->id()); } diff --git a/core/modules/field/lib/Drupal/field/Tests/FormTest.php b/core/modules/field/lib/Drupal/field/Tests/FormTest.php index 5de1d0a..d76d8b2 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FormTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FormTest.php @@ -151,7 +151,7 @@ function testFieldFormSingle() { ); $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated'); - $this->container->get('entity.manager')->getStorageController('entity_test')->resetCache(array($id)); + $this->container->get('entity.manager')->getStorage('entity_test')->resetCache(array($id)); $entity = entity_load('entity_test', $id); $this->assertEqual($entity->{$field_name}->value, $value, 'Field value was updated'); @@ -164,7 +164,7 @@ function testFieldFormSingle() { ); $this->drupalPostForm('entity_test/manage/' . $id, $edit, t('Save')); $this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated'); - $this->container->get('entity.manager')->getStorageController('entity_test')->resetCache(array($id)); + $this->container->get('entity.manager')->getStorage('entity_test')->resetCache(array($id)); $entity = entity_load('entity_test', $id); $this->assertTrue($entity->{$field_name}->isEmpty(), 'Field was emptied'); } @@ -568,7 +568,7 @@ function testFieldFormAccess() { $this->drupalPostForm($entity_type . '/manage/' . $id, $edit, t('Save')); // Check that the new revision has the expected values. - $this->container->get('entity.manager')->getStorageController($entity_type)->resetCache(array($id)); + $this->container->get('entity.manager')->getStorage($entity_type)->resetCache(array($id)); $entity = entity_load($entity_type, $id); $this->assertEqual($entity->$field_name_no_access->value, 99, 'New revision has the expected value for the field with no edit access.'); $this->assertEqual($entity->$field_name->value, 2, 'New revision has the expected value for the field with edit access.'); diff --git a/core/modules/field/lib/Drupal/field/Tests/Views/ApiDataTest.php b/core/modules/field/lib/Drupal/field/Tests/Views/ApiDataTest.php index be84f86..f8c48f5 100644 --- a/core/modules/field/lib/Drupal/field/Tests/Views/ApiDataTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/Views/ApiDataTest.php @@ -6,7 +6,7 @@ */ namespace Drupal\field\Tests\Views; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; /** * Test the produced views_data. @@ -62,8 +62,8 @@ function testViewsData() { // Check the table and the joins of the first field. // Attached to node only. $field = $this->fields[0]; - $current_table = FieldableDatabaseStorageController::_fieldTableName($field); - $revision_table = FieldableDatabaseStorageController::_fieldRevisionTableName($field); + $current_table = FieldableDatabaseEntityStorage::_fieldTableName($field); + $revision_table = FieldableDatabaseEntityStorage::_fieldRevisionTableName($field); $data[$current_table] = $views_data->get($current_table); $data[$revision_table] = $views_data->get($revision_table); diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Access/FormModeAccessCheck.php b/core/modules/field_ui/lib/Drupal/field_ui/Access/FormModeAccessCheck.php index 48de41e..e8d3acd 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Access/FormModeAccessCheck.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Access/FormModeAccessCheck.php @@ -51,7 +51,7 @@ public function access(Route $route, Request $request, AccountInterface $account if (!$form_mode || $form_mode == 'default') { $visibility = TRUE; } - elseif ($entity_display = $this->entityManager->getStorageController('entity_form_display')->load($entity_type_id . '.' . $bundle . '.' . $form_mode)) { + elseif ($entity_display = $this->entityManager->getStorage('entity_form_display')->load($entity_type_id . '.' . $bundle . '.' . $form_mode)) { $visibility = $entity_display->status(); } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Access/ViewModeAccessCheck.php b/core/modules/field_ui/lib/Drupal/field_ui/Access/ViewModeAccessCheck.php index 8b115df..baa15f8 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Access/ViewModeAccessCheck.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Access/ViewModeAccessCheck.php @@ -51,7 +51,7 @@ public function access(Route $route, Request $request, AccountInterface $account if (!$view_mode || $view_mode == 'default') { $visibility = TRUE; } - elseif ($entity_display = $this->entityManager->getStorageController('entity_view_display')->load($entity_type_id . '.' . $bundle . '.' . $view_mode)) { + elseif ($entity_display = $this->entityManager->getStorage('entity_view_display')->load($entity_type_id . '.' . $bundle . '.' . $view_mode)) { $visibility = $entity_display->status(); } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListBuilder.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListBuilder.php index d6dfa49..71ca293 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListBuilder.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldConfigListBuilder.php @@ -61,7 +61,7 @@ class FieldConfigListBuilder extends ConfigEntityListBuilder { * The 'field type' plugin manager. */ public function __construct(EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_manager) { - parent::__construct($entity_type, $entity_manager->getStorageController($entity_type->id())); + parent::__construct($entity_type, $entity_manager->getStorage($entity_type->id())); $this->entityManager = $entity_manager; $this->bundles = entity_get_bundles(); diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php index bf213a2..906ebe0 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -408,8 +408,8 @@ public function submitForm(array &$form, array &$form_state) { // Create the field and instance. try { - $this->entityManager->getStorageController('field_config')->create($field)->save(); - $new_instance = $this->entityManager->getStorageController('field_instance_config')->create($instance); + $this->entityManager->getStorage('field_config')->create($field)->save(); + $new_instance = $this->entityManager->getStorage('field_instance_config')->create($instance); $new_instance->save(); // Make sure the field is displayed in the 'default' form mode (using @@ -461,7 +461,7 @@ public function submitForm(array &$form, array &$form_state) { ); try { - $new_instance = $this->entityManager->getStorageController('field_instance_config')->create($instance); + $new_instance = $this->entityManager->getStorage('field_instance_config')->create($instance); $new_instance->save(); // Make sure the field is displayed in the 'default' form mode (using @@ -530,7 +530,7 @@ protected function getExistingFieldOptions() { // Load the instances and build the list of options. if ($instance_ids) { $field_types = $this->fieldTypeManager->getDefinitions(); - $instances = $this->entityManager->getStorageController('field_instance_config')->loadMultiple($instance_ids); + $instances = $this->entityManager->getStorage('field_instance_config')->loadMultiple($instance_ids); foreach ($instances as $instance) { // Do not show: // - locked fields, diff --git a/core/modules/field_ui/tests/modules/field_ui_test/lib/Drupal/field_ui_test/Entity/FieldUITestNoBundle.php b/core/modules/field_ui/tests/modules/field_ui_test/lib/Drupal/field_ui_test/Entity/FieldUITestNoBundle.php index ce414ef..d945b7f 100644 --- a/core/modules/field_ui/tests/modules/field_ui_test/lib/Drupal/field_ui_test/Entity/FieldUITestNoBundle.php +++ b/core/modules/field_ui/tests/modules/field_ui_test/lib/Drupal/field_ui_test/Entity/FieldUITestNoBundle.php @@ -16,7 +16,7 @@ * id = "field_ui_test_no_bundle", * label = @Translation("Test Field UI entity, no bundle"), * controllers = { - * "storage" = "Drupal\Core\Entity\DatabaseStorageController" + * "storage" = "Drupal\Core\Entity\DatabaseEntityStorage" * }, * fieldable = TRUE * ) diff --git a/core/modules/file/file.api.php b/core/modules/file/file.api.php index 202081d..760f7f9 100644 --- a/core/modules/file/file.api.php +++ b/core/modules/file/file.api.php @@ -172,7 +172,7 @@ function hook_file_move(Drupal\file\FileInterface $file, Drupal\file\FileInterfa * The file that is about to be deleted. * * @see hook_file_delete() - * @see \Drupal\file\FileStorageController::delete() + * @see \Drupal\file\FileStorage::delete() * @see upload_file_delete() */ function hook_file_predelete(Drupal\file\FileInterface $file) { @@ -190,7 +190,7 @@ function hook_file_predelete(Drupal\file\FileInterface $file) { * The file that has just been deleted. * * @see hook_file_predelete() - * @see \Drupal\file\FileStorageController::delete() + * @see \Drupal\file\FileStorage::delete() */ function hook_file_delete(Drupal\file\FileInterface $file) { // Delete all information associated with the file. diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 67e5452..3843be9 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -8,7 +8,7 @@ use Drupal\file\Entity\File; use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\Unicode; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Template\Attribute; use Drupal\file\FileUsage\FileUsageInterface; @@ -383,7 +383,7 @@ function file_validate_size(File $file, $file_limit = 0, $user_limit = 0) { } // Save a query by only calling spaceUsed() when a limit is provided. - if ($user_limit && (\Drupal::entityManager()->getStorageController('file')->spaceUsed($user->id()) + $file->getSize()) > $user_limit) { + if ($user_limit && (\Drupal::entityManager()->getStorage('file')->spaceUsed($user->id()) + $file->getSize()) > $user_limit) { $errors[] = t('The file is %filesize which would exceed your disk quota of %quota.', array('%filesize' => format_size($file->getSize()), '%quota' => format_size($user_limit))); } @@ -619,7 +619,7 @@ function file_file_download($uri, $field_type = 'file') { } // Find out which (if any) fields of this type contain the file. - $references = file_get_file_references($file, NULL, EntityStorageControllerInterface::FIELD_LOAD_CURRENT, $field_type); + $references = file_get_file_references($file, NULL, EntityStorageInterface::FIELD_LOAD_CURRENT, $field_type); // Stop processing if there are no references in order to avoid returning // headers for files controlled by other modules. Make an exception for @@ -693,7 +693,7 @@ function file_file_download($uri, $field_type = 'file') { * Implements file_cron() */ function file_cron() { - $result = \Drupal::entityManager()->getStorageController('file')->retrieveTemporaryFiles(); + $result = \Drupal::entityManager()->getStorage('file')->retrieveTemporaryFiles(); foreach ($result as $row) { if ($file = file_load($row->fid)) { $references = \Drupal::service('file.usage')->listUsage($file); @@ -1843,9 +1843,9 @@ function file_icon_map(File $file) { * reference check to the given field. * @param $age * (optional) A constant that specifies which references to count. Use - * EntityStorageControllerInterface::FIELD_LOAD_REVISION to retrieve all + * EntityStorageInterface::FIELD_LOAD_REVISION to retrieve all * references within all revisions or - * EntityStorageControllerInterface::FIELD_LOAD_CURRENT to retrieve references + * EntityStorageInterface::FIELD_LOAD_CURRENT to retrieve references * only in the current revisions. * @param $field_type * (optional) The name of a field type. If given, limits the reference check @@ -1857,7 +1857,7 @@ function file_icon_map(File $file) { * A multidimensional array. The keys are field_name, entity_type, * entity_id and the value is an entity referencing this file. */ -function file_get_file_references(File $file, $field = NULL, $age = EntityStorageControllerInterface::FIELD_LOAD_REVISION, $field_type = 'file') { +function file_get_file_references(File $file, $field = NULL, $age = EntityStorageInterface::FIELD_LOAD_REVISION, $field_type = 'file') { $references = &drupal_static(__FUNCTION__, array()); $field_columns = &drupal_static(__FUNCTION__ . ':field_columns', array()); @@ -1871,7 +1871,7 @@ function file_get_file_references(File $file, $field = NULL, $age = EntityStorag // The usage table contains usage of every revision. If we are looking // for every revision or the entity does not support revisions then // every usage is already a match. - $match_entity_type = $age == EntityStorageControllerInterface::FIELD_LOAD_REVISION || !$entity_type->hasKey('revision'); + $match_entity_type = $age == EntityStorageInterface::FIELD_LOAD_REVISION || !$entity_type->hasKey('revision'); $entities = entity_load_multiple($entity_type_id, array_keys($entity_ids)); foreach ($entities as $entity) { $bundle = $entity->bundle(); diff --git a/core/modules/file/file.views.inc b/core/modules/file/file.views.inc index bd90aef..a5cafd8 100644 --- a/core/modules/file/file.views.inc +++ b/core/modules/file/file.views.inc @@ -5,7 +5,7 @@ * Provide views data for file.module. */ -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\field\FieldConfigInterface; /** @@ -515,7 +515,7 @@ function file_field_views_data_views_data_alter(array &$data, FieldConfigInterfa 'id' => 'entity_reverse', 'field_name' => $field_name, 'entity_type' => $entity_type_id, - 'field table' => FieldableDatabaseStorageController::_fieldTableName($field), + 'field table' => FieldableDatabaseEntityStorage::_fieldTableName($field), 'field field' => $field_name . '_target_id', 'base' => $entity_type->getBaseTable(), 'base field' => $entity_type->getKey('id'), diff --git a/core/modules/file/lib/Drupal/file/Entity/File.php b/core/modules/file/lib/Drupal/file/Entity/File.php index 4618986..92e1e90 100644 --- a/core/modules/file/lib/Drupal/file/Entity/File.php +++ b/core/modules/file/lib/Drupal/file/Entity/File.php @@ -8,7 +8,7 @@ namespace Drupal\file\Entity; use Drupal\Core\Entity\ContentEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; use Drupal\Core\Language\Language; @@ -22,7 +22,7 @@ * id = "file", * label = @Translation("File"), * controllers = { - * "storage" = "Drupal\file\FileStorageController", + * "storage" = "Drupal\file\FileStorage", * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder" * }, * base_table = "file_managed", @@ -184,7 +184,7 @@ public function setTemporary() { /** * {@inheritdoc} */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { + public static function preCreate(EntityStorageInterface $storage, array &$values) { // Automatically detect filename if not set. if (!isset($values['filename']) && isset($values['uri'])) { $values['filename'] = drupal_basename($values['uri']); @@ -199,8 +199,8 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { - parent::preSave($storage_controller); + public function preSave(EntityStorageInterface $storage) { + parent::preSave($storage); $this->setSize(filesize($this->getFileUri())); } @@ -208,8 +208,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::preDelete($storage_controller, $entities); + public static function preDelete(EntityStorageInterface $storage, array $entities) { + parent::preDelete($storage, $entities); foreach ($entities as $entity) { // Delete all remaining references to this file. diff --git a/core/modules/file/lib/Drupal/file/FileStorageController.php b/core/modules/file/lib/Drupal/file/FileStorage.php similarity index 78% rename from core/modules/file/lib/Drupal/file/FileStorageController.php rename to core/modules/file/lib/Drupal/file/FileStorage.php index afa6b0b..80173eb 100644 --- a/core/modules/file/lib/Drupal/file/FileStorageController.php +++ b/core/modules/file/lib/Drupal/file/FileStorage.php @@ -2,17 +2,17 @@ /** * @file - * Definition of Drupal\file\FileStorageController. + * Definition of Drupal\file\FileStorage. */ namespace Drupal\file; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; /** - * File storage controller for files. + * File storage for files. */ -class FileStorageController extends FieldableDatabaseStorageController implements FileStorageControllerInterface { +class FileStorage extends FieldableDatabaseEntityStorage implements FileStorageInterface { /** * {@inheritdoc} diff --git a/core/modules/file/lib/Drupal/file/FileStorageControllerInterface.php b/core/modules/file/lib/Drupal/file/FileStorageInterface.php similarity index 81% rename from core/modules/file/lib/Drupal/file/FileStorageControllerInterface.php rename to core/modules/file/lib/Drupal/file/FileStorageInterface.php index 913d172..627d577 100644 --- a/core/modules/file/lib/Drupal/file/FileStorageControllerInterface.php +++ b/core/modules/file/lib/Drupal/file/FileStorageInterface.php @@ -2,17 +2,17 @@ /** * @file - * Contains \Drupal\file\FileStorageControllerInterface. + * Contains \Drupal\file\FileStorageInterface. */ namespace Drupal\file; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines a common interface for file entity controller classes. */ -interface FileStorageControllerInterface extends EntityStorageControllerInterface { +interface FileStorageInterface extends EntityStorageInterface { /** * Determines total disk space used by a single user or the whole filesystem. diff --git a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileFieldItemList.php b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileFieldItemList.php index a250229..7777098 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileFieldItemList.php +++ b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileFieldItemList.php @@ -62,7 +62,7 @@ public function update() { // Decrement file usage by 1 for files that were removed from the field. $removed_fids = array_filter(array_diff($original_fids, $fids)); - $removed_files = \Drupal::entityManager()->getStorageController('file')->loadMultiple($removed_fids); + $removed_files = \Drupal::entityManager()->getStorage('file')->loadMultiple($removed_fids); foreach ($removed_files as $file) { \Drupal::service('file.usage')->delete($file, 'file', $entity->getEntityTypeId(), $entity->id()); } @@ -120,7 +120,7 @@ protected function targetEntities() { // Prevent NULLs as target IDs. $ids = array_filter($ids); - return $ids ? \Drupal::entityManager()->getStorageController('file')->loadMultiple($ids) : array(); + return $ids ? \Drupal::entityManager()->getStorage('file')->loadMultiple($ids) : array(); } } diff --git a/core/modules/file/lib/Drupal/file/Plugin/views/argument/Fid.php b/core/modules/file/lib/Drupal/file/Plugin/views/argument/Fid.php index 96fa5ab..d8c8b18 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/views/argument/Fid.php +++ b/core/modules/file/lib/Drupal/file/Plugin/views/argument/Fid.php @@ -77,7 +77,7 @@ public function titleQuery() { $fids = $this->entityQuery->get('file') ->condition('fid', $this->value) ->execute(); - $controller = $this->entityManager->getStorageController('file'); + $controller = $this->entityManager->getStorage('file'); $files = $controller->loadMultiple($fids); $titles = array(); foreach ($files as $file) { diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php index 82d043a..a7df01d 100644 --- a/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php +++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldTestBase.php @@ -209,7 +209,7 @@ function assertFileExists($file, $message = NULL) { * Asserts that a file exists in the database. */ function assertFileEntryExists($file, $message = NULL) { - $this->container->get('entity.manager')->getStorageController('file')->resetCache(); + $this->container->get('entity.manager')->getStorage('file')->resetCache(); $db_file = file_load($file->id()); $message = isset($message) ? $message : format_string('File %file exists in database at the correct path.', array('%file' => $file->getFileUri())); $this->assertEqual($db_file->getFileUri(), $file->getFileUri(), $message); @@ -227,7 +227,7 @@ function assertFileNotExists($file, $message = NULL) { * Asserts that a file does not exist in the database. */ function assertFileEntryNotExists($file, $message) { - $this->container->get('entity.manager')->getStorageController('file')->resetCache(); + $this->container->get('entity.manager')->getStorage('file')->resetCache(); $message = isset($message) ? $message : format_string('File %file exists in database at the correct path.', array('%file' => $file->getFileUri())); $this->assertFalse(file_load($file->id()), $message); } diff --git a/core/modules/file/lib/Drupal/file/Tests/SpaceUsedTest.php b/core/modules/file/lib/Drupal/file/Tests/SpaceUsedTest.php index 325990e..a0c8e33 100644 --- a/core/modules/file/lib/Drupal/file/Tests/SpaceUsedTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/SpaceUsedTest.php @@ -43,7 +43,7 @@ function setUp() { * Test different users with the default status. */ function testFileSpaceUsed() { - $file = $this->container->get('entity.manager')->getStorageController('file'); + $file = $this->container->get('entity.manager')->getStorage('file'); // Test different users with default status. $this->assertEqual($file->spaceUsed(2), 70); $this->assertEqual($file->spaceUsed(3), 300); diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 9c166e5..f494ea6 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -164,7 +164,7 @@ function filter_formats(AccountInterface $account = NULL) { $formats['all'] = $cache->data; } else { - $formats['all'] = \Drupal::entityManager()->getStorageController('filter_format')->loadByProperties(array('status' => TRUE)); + $formats['all'] = \Drupal::entityManager()->getStorage('filter_format')->loadByProperties(array('status' => TRUE)); uasort($formats['all'], 'Drupal\Core\Config\Entity\ConfigEntityBase::sort'); \Drupal::cache()->set("filter_formats:{$language_interface->id}", $formats['all'], Cache::PERMANENT, array('filter_formats' => TRUE)); } diff --git a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php index 8e0aadd..4b36306 100644 --- a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php +++ b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php @@ -10,7 +10,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Config\Entity\EntityWithPluginBagInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\filter\FilterFormatInterface; use Drupal\filter\FilterBag; use Drupal\filter\Plugin\FilterInterface; @@ -204,11 +204,11 @@ public function disable() { /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { + public function preSave(EntityStorageInterface $storage) { // Ensure the filters have been sorted before saving. $this->filters()->sort(); - parent::preSave($storage_controller); + parent::preSave($storage); $this->name = trim($this->label()); @@ -228,8 +228,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); // Clear the static caches of filter_formats() and others. filter_formats_reset(); diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatListBuilder.php b/core/modules/filter/lib/Drupal/filter/FilterFormatListBuilder.php index 7ba51af..a22b998 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatListBuilder.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatListBuilder.php @@ -11,7 +11,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\Entity\DraggableListBuilder; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -39,12 +39,12 @@ class FilterFormatListBuilder extends DraggableListBuilder { * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The config factory. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, ConfigFactoryInterface $config_factory) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, ConfigFactoryInterface $config_factory) { parent::__construct($entity_type, $storage); $this->configFactory = $config_factory; @@ -56,7 +56,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('config.factory') ); } diff --git a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php index 01a2566..5de156c 100644 --- a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php +++ b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php @@ -10,8 +10,8 @@ use Drupal\Core\Controller\ControllerBase; use Drupal\forum\ForumManagerInterface; use Drupal\taxonomy\TermInterface; -use Drupal\taxonomy\TermStorageControllerInterface; -use Drupal\taxonomy\VocabularyStorageControllerInterface; +use Drupal\taxonomy\TermStorageInterface; +use Drupal\taxonomy\VocabularyStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -27,33 +27,33 @@ class ForumController extends ControllerBase { protected $forumManager; /** - * Vocabulary storage controller. + * Vocabulary storage. * - * @var \Drupal\taxonomy\VocabularyStorageControllerInterface + * @var \Drupal\taxonomy\VocabularyStorageInterface */ - protected $vocabularyStorageController; + protected $vocabularyStorage; /** - * Term storage controller. + * Term storage. * - * @var \Drupal\taxonomy\TermStorageControllerInterface + * @var \Drupal\taxonomy\TermStorageInterface */ - protected $termStorageController; + protected $termStorage; /** * Constructs a ForumController object. * * @param \Drupal\forum\ForumManagerInterface $forum_manager * The forum manager service. - * @param \Drupal\taxonomy\VocabularyStorageControllerInterface $vocabulary_storage_controller - * Vocabulary storage controller. - * @param \Drupal\taxonomy\TermStorageControllerInterface $term_storage_controller - * Term storage controller. + * @param \Drupal\taxonomy\VocabularyStorageInterface $vocabulary_storage + * Vocabulary storage. + * @param \Drupal\taxonomy\TermStorageInterface $term_storage + * Term storage. */ - public function __construct(ForumManagerInterface $forum_manager, VocabularyStorageControllerInterface $vocabulary_storage_controller, TermStorageControllerInterface $term_storage_controller) { + public function __construct(ForumManagerInterface $forum_manager, VocabularyStorageInterface $vocabulary_storage, TermStorageInterface $term_storage) { $this->forumManager = $forum_manager; - $this->vocabularyStorageController = $vocabulary_storage_controller; - $this->termStorageController = $term_storage_controller; + $this->vocabularyStorage = $vocabulary_storage; + $this->termStorage = $term_storage; } /** @@ -62,8 +62,8 @@ public function __construct(ForumManagerInterface $forum_manager, VocabularyStor public static function create(ContainerInterface $container) { return new static( $container->get('forum_manager'), - $container->get('entity.manager')->getStorageController('taxonomy_vocabulary'), - $container->get('entity.manager')->getStorageController('taxonomy_term') + $container->get('entity.manager')->getStorage('taxonomy_vocabulary'), + $container->get('entity.manager')->getStorage('taxonomy_term') ); } @@ -100,7 +100,7 @@ public function forumPage(TermInterface $taxonomy_term) { * A render array. */ public function forumIndex() { - $vocabulary = $this->vocabularyStorageController->load($this->config('forum.settings')->get('vocabulary')); + $vocabulary = $this->vocabularyStorage->load($this->config('forum.settings')->get('vocabulary')); $index = $this->forumManager->getIndex(); $build = $this->build($index->forums, $index); if (empty($index->forums)) { @@ -159,7 +159,7 @@ protected function build($forums, TermInterface $term, $topics = array(), $paren */ public function addForum() { $vid = $this->config('forum.settings')->get('vocabulary'); - $taxonomy_term = $this->termStorageController->create(array( + $taxonomy_term = $this->termStorage->create(array( 'vid' => $vid, 'forum_controller' => 0, )); @@ -174,7 +174,7 @@ public function addForum() { */ public function addContainer() { $vid = $this->config('forum.settings')->get('vocabulary'); - $taxonomy_term = $this->termStorageController->create(array( + $taxonomy_term = $this->termStorage->create(array( 'vid' => $vid, 'forum_container' => 1, )); diff --git a/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php b/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php index fe0d5a2..fc12225 100644 --- a/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php +++ b/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php @@ -76,7 +76,7 @@ public function buildEntity(array $form, array &$form_state) { */ public function save(array $form, array &$form_state) { $term = $this->entity; - $term_storage = $this->entityManager->getStorageController('taxonomy_term'); + $term_storage = $this->entityManager->getStorage('taxonomy_term'); $status = $term_storage->save($term); switch ($status) { diff --git a/core/modules/forum/lib/Drupal/forum/Form/Overview.php b/core/modules/forum/lib/Drupal/forum/Form/Overview.php index d31387c..b2e84e7 100644 --- a/core/modules/forum/lib/Drupal/forum/Form/Overview.php +++ b/core/modules/forum/lib/Drupal/forum/Form/Overview.php @@ -62,7 +62,7 @@ public function getFormId() { public function buildForm(array $form, array &$form_state) { $forum_config = $this->config('forum.settings'); $vid = $forum_config->get('vocabulary'); - $vocabulary = $this->entityManager->getStorageController('taxonomy_vocabulary')->load($vid); + $vocabulary = $this->entityManager->getStorage('taxonomy_vocabulary')->load($vid); if (!$vocabulary) { throw new NotFoundHttpException(); } diff --git a/core/modules/forum/lib/Drupal/forum/ForumBreadcrumbBuilder.php b/core/modules/forum/lib/Drupal/forum/ForumBreadcrumbBuilder.php index 80abfc6..f8e20d1 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumBreadcrumbBuilder.php +++ b/core/modules/forum/lib/Drupal/forum/ForumBreadcrumbBuilder.php @@ -81,7 +81,7 @@ public function build(array $attributes) { * Builds the breadcrumb for a forum post page. */ protected function forumPostBreadcrumb($node) { - $vocabulary = $this->entityManager->getStorageController('taxonomy_vocabulary')->load($this->config->get('vocabulary')); + $vocabulary = $this->entityManager->getStorage('taxonomy_vocabulary')->load($this->config->get('vocabulary')); $breadcrumb[] = $this->l($this->t('Home'), ''); $breadcrumb[] = l($vocabulary->label(), 'forum'); @@ -98,7 +98,7 @@ protected function forumPostBreadcrumb($node) { * Builds the breadcrumb for a forum term page. */ protected function forumTermBreadcrumb($term) { - $vocabulary = $this->entityManager->getStorageController('taxonomy_vocabulary')->load($this->config->get('vocabulary')); + $vocabulary = $this->entityManager->getStorage('taxonomy_vocabulary')->load($this->config->get('vocabulary')); $breadcrumb[] = $this->l($this->t('Home'), ''); if ($term->tid) { diff --git a/core/modules/forum/lib/Drupal/forum/ForumManager.php b/core/modules/forum/lib/Drupal/forum/ForumManager.php index fc3f933..388dd4a 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumManager.php +++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php @@ -180,7 +180,7 @@ public function getTopics($tid, AccountInterface $account) { $nids[] = $record->nid; } if ($nids) { - $nodes = $this->entityManager->getStorageController('node')->loadMultiple($nids); + $nodes = $this->entityManager->getStorage('node')->loadMultiple($nids); $query = $this->connection->select('node_field_data', 'n') ->extend('Drupal\Core\Database\Query\TableSortExtender'); @@ -452,7 +452,7 @@ public function getIndex() { } $vid = $this->configFactory->get('forum.settings')->get('vocabulary'); - $index = $this->entityManager->getStorageController('taxonomy_term')->create(array( + $index = $this->entityManager->getStorage('taxonomy_term')->create(array( 'tid' => 0, 'container' => 1, 'parents' => array(), diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index d7f8dd0..c7d8b64 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -395,7 +395,7 @@ function createForum($type, $parent = 0) { $parent_tid = db_query("SELECT t.parent FROM {taxonomy_term_hierarchy} t WHERE t.tid = :tid", array(':tid' => $tid))->fetchField(); $this->assertTrue($parent == $parent_tid, 'The ' . $type . ' is linked to its container'); - $forum = $this->container->get('entity.manager')->getStorageController('taxonomy_term')->load($tid); + $forum = $this->container->get('entity.manager')->getStorage('taxonomy_term')->load($tid); $this->assertEqual(($type == 'forum container'), (bool) $forum->forum_container->value); return $term; } diff --git a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php index a5b2a75..65d9f1b 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php @@ -51,10 +51,10 @@ protected function setUp() { public function testForumIntegration() { // Create a forum. $entity_manager = $this->container->get('entity.manager'); - $term = $entity_manager->getStorageController('taxonomy_term')->create(array('vid' => 'forums')); + $term = $entity_manager->getStorage('taxonomy_term')->create(array('vid' => 'forums')); $term->save(); - $comment_storage_controller = $entity_manager->getStorageController('comment'); + $comment_storage = $entity_manager->getStorage('comment'); // Create some nodes which are part of this forum with some comments. $nodes = array(); @@ -69,7 +69,7 @@ public function testForumIntegration() { $comments = array(); foreach ($nodes as $index => $node) { for ($i = 0; $i <= $index; $i++) { - $comment = $comment_storage_controller->create(array('entity_type' => 'node', 'entity_id' => $node->id(), 'field_name' => 'comment_forum')); + $comment = $comment_storage->create(array('entity_type' => 'node', 'entity_id' => $node->id(), 'field_name' => 'comment_forum')); $comment->save(); $comments[$comment->get('entity_id')->target_id][$comment->id()] = $comment; } diff --git a/core/modules/forum/tests/Drupal/forum/Tests/ForumManagerTest.php b/core/modules/forum/tests/Drupal/forum/Tests/ForumManagerTest.php index ab02d1d..ccb79de 100644 --- a/core/modules/forum/tests/Drupal/forum/Tests/ForumManagerTest.php +++ b/core/modules/forum/tests/Drupal/forum/Tests/ForumManagerTest.php @@ -30,7 +30,7 @@ public static function getInfo() { public function testGetIndex() { $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - $storage_controller = $this->getMockBuilder('\Drupal\taxonomy\VocabularyStorageController') + $storage = $this->getMockBuilder('\Drupal\taxonomy\VocabularyStorage') ->disableOriginalConstructor() ->getMock(); @@ -49,13 +49,13 @@ public function testGetIndex() { ->will($this->returnValue('forums')); $entity_manager->expects($this->once()) - ->method('getStorageController') - ->will($this->returnValue($storage_controller)); + ->method('getStorage') + ->will($this->returnValue($storage)); // This is sufficient for testing purposes. $term = new \stdClass(); - $storage_controller->expects($this->once()) + $storage->expects($this->once()) ->method('create') ->will($this->returnValue($term)); diff --git a/core/modules/hal/lib/Drupal/hal/Normalizer/FileEntityNormalizer.php b/core/modules/hal/lib/Drupal/hal/Normalizer/FileEntityNormalizer.php index 815ed6e..3d9b102 100644 --- a/core/modules/hal/lib/Drupal/hal/Normalizer/FileEntityNormalizer.php +++ b/core/modules/hal/lib/Drupal/hal/Normalizer/FileEntityNormalizer.php @@ -77,7 +77,7 @@ public function denormalize($data, $class, $format = NULL, array $context = arra $path = 'temporary://' . drupal_basename($data['uri'][0]['value']); $data['uri'] = file_unmanaged_save_data($file_data, $path); - return $this->entityManager->getStorageController('file')->create($data); + return $this->entityManager->getStorage('file')->create($data); } } diff --git a/core/modules/image/image.views.inc b/core/modules/image/image.views.inc index 57a3943..87b9d19 100644 --- a/core/modules/image/image.views.inc +++ b/core/modules/image/image.views.inc @@ -5,7 +5,7 @@ * Provide views data for image.module. */ -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\field\FieldConfigInterface; /** @@ -50,7 +50,7 @@ function image_field_views_data_views_data_alter(array &$data, FieldConfigInterf 'id' => 'entity_reverse', 'field_name' => $field_name, 'entity_type' => $entity_type_id, - 'field table' => FieldableDatabaseStorageController::_fieldTableName($field), + 'field table' => FieldableDatabaseEntityStorage::_fieldTableName($field), 'field field' => $field_name . '_target_id', 'base' => $entity_type->getBaseTable(), 'base field' => $entity_type->getKey('id'), diff --git a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php index 55f19a6..0122502 100644 --- a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php +++ b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php @@ -9,7 +9,7 @@ use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Config\Entity\EntityWithPluginBagInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\image\ImageEffectBag; use Drupal\image\ImageEffectInterface; use Drupal\image\ImageStyleInterface; @@ -97,8 +97,8 @@ public function id() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); if ($update) { if (!empty($this->original) && $this->id() !== $this->original->id()) { @@ -117,8 +117,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); foreach ($entities as $style) { // Flush cached media for the deleted style. diff --git a/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php b/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php index a589feb..a73671f 100644 --- a/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php +++ b/core/modules/image/lib/Drupal/image/Form/ImageStyleEditForm.php @@ -8,7 +8,7 @@ namespace Drupal\image\Form; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\image\ConfigurableImageEffectInterface; use Drupal\image\ImageEffectManager; use Drupal\Component\Utility\String; @@ -29,12 +29,12 @@ class ImageStyleEditForm extends ImageStyleFormBase { /** * Constructs an ImageStyleEditForm object. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $image_style_storage - * The storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $image_style_storage + * The storage. * @param \Drupal\image\ImageEffectManager $image_effect_manager * The image effect manager service. */ - public function __construct(EntityStorageControllerInterface $image_style_storage, ImageEffectManager $image_effect_manager) { + public function __construct(EntityStorageInterface $image_style_storage, ImageEffectManager $image_effect_manager) { parent::__construct($image_style_storage); $this->imageEffectManager = $image_effect_manager; } @@ -44,7 +44,7 @@ public function __construct(EntityStorageControllerInterface $image_style_storag */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('image_style'), + $container->get('entity.manager')->getStorage('image_style'), $container->get('plugin.manager.image.effect') ); } diff --git a/core/modules/image/lib/Drupal/image/Form/ImageStyleFormBase.php b/core/modules/image/lib/Drupal/image/Form/ImageStyleFormBase.php index 430b802..1547ca7 100644 --- a/core/modules/image/lib/Drupal/image/Form/ImageStyleFormBase.php +++ b/core/modules/image/lib/Drupal/image/Form/ImageStyleFormBase.php @@ -8,7 +8,7 @@ namespace Drupal\image\Form; use Drupal\Core\Entity\EntityFormController; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -17,19 +17,19 @@ abstract class ImageStyleFormBase extends EntityFormController { /** - * The image style entity storage controller. + * The image style entity storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $imageStyleStorage; /** * Constructs a base class for image style add and edit forms. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $image_style_storage - * The image style entity storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $image_style_storage + * The image style entity storage. */ - public function __construct(EntityStorageControllerInterface $image_style_storage) { + public function __construct(EntityStorageInterface $image_style_storage) { $this->imageStyleStorage = $image_style_storage; } @@ -38,7 +38,7 @@ public function __construct(EntityStorageControllerInterface $image_style_storag */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('image_style') + $container->get('entity.manager')->getStorage('image_style') ); } diff --git a/core/modules/image/lib/Drupal/image/ImageStyleListBuilder.php b/core/modules/image/lib/Drupal/image/ImageStyleListBuilder.php index e6eac9e..2b98b07 100644 --- a/core/modules/image/lib/Drupal/image/ImageStyleListBuilder.php +++ b/core/modules/image/lib/Drupal/image/ImageStyleListBuilder.php @@ -9,7 +9,7 @@ use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Routing\UrlGeneratorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -33,12 +33,12 @@ class ImageStyleListBuilder extends ConfigEntityListBuilder { * * @param EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $image_style_storage - * The image style entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $image_style_storage + * The image style entity storage class. * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator * The URL generator. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $image_style_storage, UrlGeneratorInterface $url_generator) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $image_style_storage, UrlGeneratorInterface $url_generator) { parent::__construct($entity_type, $image_style_storage); $this->urlGenerator = $url_generator; } @@ -49,7 +49,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('url_generator'), $container->get('string_translation') ); diff --git a/core/modules/language/lib/Drupal/language/Entity/Language.php b/core/modules/language/lib/Drupal/language/Entity/Language.php index 244607f..77015cd 100644 --- a/core/modules/language/lib/Drupal/language/Entity/Language.php +++ b/core/modules/language/lib/Drupal/language/Entity/Language.php @@ -8,7 +8,7 @@ namespace Drupal\language\Entity; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\language\Exception\DeleteDefaultLanguageException; use Drupal\language\LanguageInterface; @@ -80,8 +80,8 @@ class Language extends ConfigEntityBase implements LanguageInterface { /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { - parent::preSave($storage_controller); + public function preSave(EntityStorageInterface $storage) { + parent::preSave($storage); // Languages are picked from a predefined list which is given in English. // For the uncommon case of custom languages the label should be given in // English. @@ -93,7 +93,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * * @throws \RuntimeException */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + public static function preDelete(EntityStorageInterface $storage, array $entities) { $default_language = \Drupal::service('language.default')->get(); foreach ($entities as $entity) { if ($entity->id() == $default_language->id && !$entity->isUninstalling()) { diff --git a/core/modules/link/lib/Drupal/link/Tests/LinkFieldTest.php b/core/modules/link/lib/Drupal/link/Tests/LinkFieldTest.php index 1be52d5..12fc40a 100644 --- a/core/modules/link/lib/Drupal/link/Tests/LinkFieldTest.php +++ b/core/modules/link/lib/Drupal/link/Tests/LinkFieldTest.php @@ -513,7 +513,7 @@ function testLinkSeparateFormatter() { */ protected function renderTestEntity($id, $view_mode = 'full', $reset = TRUE) { if ($reset) { - $this->container->get('entity.manager')->getStorageController('entity_test')->resetCache(array($id)); + $this->container->get('entity.manager')->getStorage('entity_test')->resetCache(array($id)); } $entity = entity_load('entity_test', $id); $display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), $view_mode); diff --git a/core/modules/locale/lib/Drupal/locale/LocaleConfigManager.php b/core/modules/locale/lib/Drupal/locale/LocaleConfigManager.php index 353fcc6..79df174 100644 --- a/core/modules/locale/lib/Drupal/locale/LocaleConfigManager.php +++ b/core/modules/locale/lib/Drupal/locale/LocaleConfigManager.php @@ -19,7 +19,7 @@ class LocaleConfigManager extends TypedConfigManager { /** - * A storage controller instance for reading default configuration data. + * A storage instance for reading default configuration data. * * @var \Drupal\Core\Config\StorageInterface */ @@ -48,11 +48,11 @@ class LocaleConfigManager extends TypedConfigManager { * Creates a new typed configuration manager. * * @param \Drupal\Core\Config\StorageInterface $configStorage - * The storage controller object to use for reading configuration data. + * The storage object to use for reading configuration data. * @param \Drupal\Core\Config\StorageInterface $schemaStorage - * The storage controller object to use for reading schema data. + * The storage object to use for reading schema data. * @param \Drupal\Core\Config\StorageInterface $installStorage - * The storage controller object to use for reading default configuration + * The storage object to use for reading default configuration * data. * @param \Drupal\locale\StringStorageInterface $localeStorage * The locale storage to use for reading string translations. diff --git a/core/modules/locale/lib/Drupal/locale/ParamConverter/LocaleAdminPathConfigEntityConverter.php b/core/modules/locale/lib/Drupal/locale/ParamConverter/LocaleAdminPathConfigEntityConverter.php index f2ef6ba..4dacd6a 100644 --- a/core/modules/locale/lib/Drupal/locale/ParamConverter/LocaleAdminPathConfigEntityConverter.php +++ b/core/modules/locale/lib/Drupal/locale/ParamConverter/LocaleAdminPathConfigEntityConverter.php @@ -68,7 +68,7 @@ public function __construct(EntityManagerInterface $entity_manager, ConfigFactor */ public function convert($value, $definition, $name, array $defaults, Request $request) { $entity_type = substr($definition['type'], strlen('entity:')); - if ($storage = $this->entityManager->getStorageController($entity_type)) { + if ($storage = $this->entityManager->getStorage($entity_type)) { // Make sure no overrides are loaded. $old_state = $this->configFactory->getOverrideState(); $this->configFactory->setOverrideState(FALSE); diff --git a/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php b/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php index 0b77263..22f4f00 100644 --- a/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php +++ b/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php @@ -49,7 +49,7 @@ public function getParentOptions(Request $request) { * Returns the menu link submission form. */ public function addLink(MenuInterface $menu) { - $menu_link = $this->entityManager()->getStorageController('menu_link')->create(array( + $menu_link = $this->entityManager()->getStorage('menu_link')->create(array( 'mlid' => 0, 'plid' => 0, 'menu_name' => $menu->id(), diff --git a/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php b/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php index c30d207..31576df 100644 --- a/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php +++ b/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php @@ -9,7 +9,7 @@ use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityConfirmFormBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -18,11 +18,11 @@ class MenuDeleteForm extends EntityConfirmFormBase { /** - * The menu link storage controller. + * The menu link storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The database connection. @@ -34,13 +34,13 @@ class MenuDeleteForm extends EntityConfirmFormBase { /** * Constructs a new MenuDeleteForm. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The menu link storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The menu link storage. * @param \Drupal\Core\Database\Connection $connection * The database connection. */ - public function __construct(EntityStorageControllerInterface $storage_controller, Connection $connection) { - $this->storageController = $storage_controller; + public function __construct(EntityStorageInterface $storage, Connection $connection) { + $this->storage = $storage; $this->connection = $connection; } @@ -49,7 +49,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('menu_link'), + $container->get('entity.manager')->getStorage('menu_link'), $container->get('database') ); } @@ -78,7 +78,7 @@ public function getCancelRoute() { */ public function getDescription() { $caption = ''; - $num_links = $this->storageController->countMenuLinks($this->entity->id()); + $num_links = $this->storage->countMenuLinks($this->entity->id()); if ($num_links) { $caption .= '

' . format_plural($num_links, 'Warning: There is currently 1 menu link in %title. It will be deleted (system-defined items will be reset).', 'Warning: There are currently @count menu links in %title. They will be deleted (system-defined links will be reset).', array('%title' => $this->entity->label())) . '

'; } @@ -110,13 +110,13 @@ public function submit(array $form, array &$form_state) { ->condition('module', 'system') ->sort('depth', 'ASC') ->execute(); - $menu_links = $this->storageController->loadMultiple($result); + $menu_links = $this->storage->loadMultiple($result); foreach ($menu_links as $link) { $link->reset(); } // Delete all links to the overview page for this menu. - $menu_links = $this->storageController->loadByProperties(array('link_path' => 'admin/structure/menu/manage/' . $this->entity->id())); + $menu_links = $this->storage->loadByProperties(array('link_path' => 'admin/structure/menu/manage/' . $this->entity->id())); menu_link_delete_multiple(array_keys($menu_links)); // Delete the custom menu and all its menu links. diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php index d6720a7..44243c7 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php +++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php @@ -11,7 +11,7 @@ use Drupal\Core\Entity\EntityFormController; use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Language\Language; -use Drupal\menu_link\MenuLinkStorageControllerInterface; +use Drupal\menu_link\MenuLinkStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -27,9 +27,9 @@ class MenuFormController extends EntityFormController { protected $entityQueryFactory; /** - * The menu link storage controller. + * The menu link storage. * - * @var \Drupal\menu_link\MenuLinkStorageControllerInterface + * @var \Drupal\menu_link\MenuLinkStorageInterface */ protected $menuLinkStorage; @@ -45,10 +45,10 @@ class MenuFormController extends EntityFormController { * * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query_factory * The factory for entity queries. - * @param \Drupal\menu_link\MenuLinkStorageControllerInterface $menu_link_storage - * The menu link storage controller. + * @param \Drupal\menu_link\MenuLinkStorageInterface $menu_link_storage + * The menu link storage. */ - public function __construct(QueryFactory $entity_query_factory, MenuLinkStorageControllerInterface $menu_link_storage) { + public function __construct(QueryFactory $entity_query_factory, MenuLinkStorageInterface $menu_link_storage) { $this->entityQueryFactory = $entity_query_factory; $this->menuLinkStorage = $menu_link_storage; } @@ -59,7 +59,7 @@ public function __construct(QueryFactory $entity_query_factory, MenuLinkStorageC public static function create(ContainerInterface $container) { return new static( $container->get('entity.query'), - $container->get('entity.manager')->getStorageController('menu_link') + $container->get('entity.manager')->getStorage('menu_link') ); } diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index fa5d8c5..e3304f4 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -17,7 +17,7 @@ use Drupal\system\Entity\Menu; use Symfony\Component\HttpFoundation\JsonResponse; use Drupal\menu_link\Entity\MenuLink; -use Drupal\menu_link\MenuLinkStorageController; +use Drupal\menu_link\MenuLinkStorage; use Drupal\node\NodeInterface; /** diff --git a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php index 36705d5..0c7da03 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php @@ -9,7 +9,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\Entity; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Url; use Drupal\menu_link\MenuLinkInterface; use Symfony\Component\Routing\Route; @@ -21,7 +21,7 @@ * id = "menu_link", * label = @Translation("Menu link"), * controllers = { - * "storage" = "Drupal\menu_link\MenuLinkStorageController", + * "storage" = "Drupal\menu_link\MenuLinkStorage", * "access" = "Drupal\menu_link\MenuLinkAccessController", * "form" = { * "default" = "Drupal\menu_link\MenuLinkFormController" @@ -306,7 +306,7 @@ public function isTranslatable() { /** * {@inheritdoc} */ - public function preSaveRevision(EntityStorageControllerInterface $storage_controller, \stdClass $record) { + public function preSaveRevision(EntityStorageInterface $storage, \stdClass $record) { } /** @@ -366,9 +366,9 @@ public function reset() { $all_links = menu_link_get_defaults(); $original = $all_links[$this->machine_name]; $original['machine_name'] = $this->machine_name; - /** @var \Drupal\menu_link\MenuLinkStorageControllerInterface $storage_controller */ - $storage_controller = \Drupal::entityManager()->getStorageController($this->entityTypeId); - $new_link = $storage_controller->createFromDefaultLink($original); + /** @var \Drupal\menu_link\MenuLinkStorageInterface $storage */ + $storage = \Drupal::entityManager()->getStorage($this->entityTypeId); + $new_link = $storage->createFromDefaultLink($original); // Merge existing menu link's ID and 'has_children' property. foreach (array('mlid', 'has_children') as $key) { $new_link->{$key} = $this->{$key}; @@ -408,21 +408,21 @@ public function offsetUnset($offset) { /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::preDelete($storage_controller, $entities); + public static function preDelete(EntityStorageInterface $storage, array $entities) { + parent::preDelete($storage, $entities); // Nothing to do if we don't want to reparent children. - if ($storage_controller->getPreventReparenting()) { + if ($storage->getPreventReparenting()) { return; } foreach ($entities as $entity) { // Children get re-attached to the item's parent. if ($entity->has_children) { - $children = $storage_controller->loadByProperties(array('plid' => $entity->plid)); + $children = $storage->loadByProperties(array('plid' => $entity->plid)); foreach ($children as $child) { $child->plid = $entity->plid; - $storage_controller->save($child); + $storage->save($child); } } } @@ -431,14 +431,14 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); $affected_menus = array(); // Update the has_children status of the parent. foreach ($entities as $entity) { - if (!$storage_controller->getPreventReparenting()) { - $storage_controller->updateParentalStatus($entity); + if (!$storage->getPreventReparenting()) { + $storage->updateParentalStatus($entity); } // Store all menu names for which we need to clear the cache. @@ -456,15 +456,15 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { - parent::preSave($storage_controller); + public function preSave(EntityStorageInterface $storage) { + parent::preSave($storage); // This is the easiest way to handle the unique internal path '', // since a path marked as external does not need to match a route. $this->external = (url_is_external($this->link_path) || $this->link_path == '') ? 1 : 0; // Try to find a parent link. If found, assign it and derive its menu. - $parent = $this->findParent($storage_controller); + $parent = $this->findParent($storage); if ($parent) { $this->plid = $parent->id(); $this->menu_name = $parent->menu_name; @@ -487,7 +487,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { // and fill parents based on the parent link. else { if ($this->has_children && $this->original) { - $limit = MENU_MAX_DEPTH - $storage_controller->findChildrenRelativeDepth($this->original) - 1; + $limit = MENU_MAX_DEPTH - $storage->findChildrenRelativeDepth($this->original) - 1; } else { $limit = MENU_MAX_DEPTH - 1; @@ -501,7 +501,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { // Need to check both plid and menu_name, since plid can be 0 in any menu. if (isset($this->original) && ($this->plid != $this->original->plid || $this->menu_name != $this->original->menu_name)) { - $storage_controller->moveChildren($this); + $storage->moveChildren($this); } // Find the route_name. @@ -518,11 +518,11 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); // Check the has_children status of the parent. - $storage_controller->updateParentalStatus($this); + $storage->updateParentalStatus($this); Cache::invalidateTags(array('menu' => $this->menu_name)); if (isset($this->original) && $this->menu_name != $this->original->menu_name) { @@ -538,8 +538,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postLoad(EntityStorageControllerInterface $storage_controller, array &$entities) { - parent::postLoad($storage_controller, $entities); + public static function postLoad(EntityStorageInterface $storage, array &$entities) { + parent::postLoad($storage, $entities); $routes = array(); foreach ($entities as $menu_link) { @@ -589,7 +589,7 @@ protected function setParents(MenuLinkInterface $parent) { /** * {@inheritdoc} */ - protected function findParent(EntityStorageControllerInterface $storage_controller) { + protected function findParent(EntityStorageInterface $storage) { $parent = FALSE; // This item is explicitely top-level, skip the rest of the parenting. @@ -612,7 +612,7 @@ protected function findParent(EntityStorageControllerInterface $storage_controll } foreach ($candidates as $mlid) { - $parent = $storage_controller->load($mlid); + $parent = $storage->load($mlid); if ($parent) { break; } diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php index e3c43a8..3f4617e 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php @@ -11,7 +11,7 @@ use Drupal\Core\Language\Language; use Drupal\Core\Path\AliasManagerInterface; use Drupal\Core\Routing\UrlGenerator; -use Drupal\menu_link\MenuLinkStorageControllerInterface; +use Drupal\menu_link\MenuLinkStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -20,11 +20,11 @@ class MenuLinkFormController extends EntityFormController { /** - * The menu link storage controller. + * The menu link storage. * - * @var \Drupal\menu_link\MenuLinkStorageControllerInterface + * @var \Drupal\menu_link\MenuLinkStorageInterface */ - protected $menuLinkStorageController; + protected $menuLinkStorage; /** * The path alias manager. @@ -43,15 +43,15 @@ class MenuLinkFormController extends EntityFormController { /** * Constructs a new MenuLinkFormController object. * - * @param \Drupal\menu_link\MenuLinkStorageControllerInterface $menu_link_storage_controller + * @param \Drupal\menu_link\MenuLinkStorageInterface $menu_link_storage * The menu link storage. * @param \Drupal\Core\Path\AliasManagerInterface $path_alias_manager * The path alias manager. * @param \Drupal\Core\Routing\UrlGenerator $url_generator * The URL generator. */ - public function __construct(MenuLinkStorageControllerInterface $menu_link_storage_controller, AliasManagerInterface $path_alias_manager, UrlGenerator $url_generator) { - $this->menuLinkStorageController = $menu_link_storage_controller; + public function __construct(MenuLinkStorageInterface $menu_link_storage, AliasManagerInterface $path_alias_manager, UrlGenerator $url_generator) { + $this->menuLinkStorage = $menu_link_storage; $this->pathAliasManager = $path_alias_manager; $this->urlGenerator = $url_generator; } @@ -61,7 +61,7 @@ public function __construct(MenuLinkStorageControllerInterface $menu_link_storag */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('menu_link'), + $container->get('entity.manager')->getStorage('menu_link'), $container->get('path.alias_manager.cached'), $container->get('url_generator') ); @@ -152,7 +152,7 @@ public function form(array $form, array &$form_state) { ); // Get number of items in menu so the weight selector is sized appropriately. - $delta = $this->menuLinkStorageController->countMenuLinks($menu_link->menu_name); + $delta = $this->menuLinkStorage->countMenuLinks($menu_link->menu_name); $form['weight'] = array( '#type' => 'weight', '#title' => t('Weight'), diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkInterface.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkInterface.php index 9ecb321..fdfab67 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkInterface.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkInterface.php @@ -26,7 +26,7 @@ public function getRoute(); /** * Sets the route object for this link. * - * This should only be called by MenuLinkStorageController when loading + * This should only be called by MenuLinkStorage when loading * the link object. Calling it at other times could result in unpredictable * behavior. * diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorage.php similarity index 95% rename from core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php rename to core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorage.php index 4c420c3..0084ce2 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorage.php @@ -2,22 +2,22 @@ /** * @file - * Contains \Drupal\menu_link\MenuLinkStorageController. + * Contains \Drupal\menu_link\MenuLinkStorage. */ namespace Drupal\menu_link; -use Drupal\Core\Entity\DatabaseStorageController; +use Drupal\Core\Entity\DatabaseEntityStorage; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageException; /** * Controller class for menu links. * - * This extends the Drupal\entity\DatabaseStorageController class, adding + * This extends the Drupal\entity\DatabaseEntityStorage class, adding * required special handling for menu_link entities. */ -class MenuLinkStorageController extends DatabaseStorageController implements MenuLinkStorageControllerInterface { +class MenuLinkStorage extends DatabaseEntityStorage implements MenuLinkStorageInterface { /** * Indicates whether the delete operation should re-parent children items. @@ -39,7 +39,7 @@ public function create(array $values = array()) { } /** - * Overrides DatabaseStorageController::save(). + * {@inheritdoc} */ public function save(EntityInterface $entity) { @@ -64,7 +64,7 @@ public function save(EntityInterface $entity) { $entity->enforceIsNew(); } - // Unlike the save() method from DatabaseStorageController, we invoke the + // Unlike the save() method from DatabaseEntityStorage, we invoke the // 'presave' hook first because we want to allow modules to alter the // entity before all the logic from our preSave() method. $this->invokeHook('presave', $entity); diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageControllerInterface.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageInterface.php similarity index 93% rename from core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageControllerInterface.php rename to core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageInterface.php index b219834..4a9d719 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageControllerInterface.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageInterface.php @@ -2,18 +2,18 @@ /** * @file - * Contains \Drupal\menu_link\MenuLinkStorageControllerInterface. + * Contains \Drupal\menu_link\MenuLinkStorageInterface. */ namespace Drupal\menu_link; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines a common interface for menu link entity controller classes. */ -interface MenuLinkStorageControllerInterface extends EntityStorageControllerInterface { +interface MenuLinkStorageInterface extends EntityStorageInterface { /** * Sets an internal flag that allows us to prevent the reparenting operations diff --git a/core/modules/menu_link/menu_link.module b/core/modules/menu_link/menu_link.module index dc86f4c..2c63de0 100644 --- a/core/modules/menu_link/menu_link.module +++ b/core/modules/menu_link/menu_link.module @@ -100,7 +100,7 @@ function menu_link_delete_multiple(array $mlids, $force = FALSE, $prevent_repare } $controller = \Drupal::entityManager() - ->getStorageController('menu_link'); + ->getStorage('menu_link'); if (!$force) { $entity_query = \Drupal::entityQuery('menu_link'); $group = $entity_query->orConditionGroup() @@ -155,7 +155,7 @@ function menu_link_save(MenuLink $menu_link) { */ function menu_link_maintain($module, $op, $link_path, $link_title = NULL) { $menu_link_controller = \Drupal::entityManager() - ->getStorageController('menu_link'); + ->getStorage('menu_link'); switch ($op) { case 'insert': $menu_link = entity_create('menu_link', array( diff --git a/core/modules/migrate/lib/Drupal/migrate/Entity/Migration.php b/core/modules/migrate/lib/Drupal/migrate/Entity/Migration.php index a1bacdc..5adea09 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Entity/Migration.php +++ b/core/modules/migrate/lib/Drupal/migrate/Entity/Migration.php @@ -23,7 +23,7 @@ * label = @Translation("Migration"), * module = "migrate", * controllers = { - * "storage" = "Drupal\migrate\MigrationStorageController" + * "storage" = "Drupal\migrate\MigrationStorage" * }, * entity_keys = { * "id" = "id", @@ -316,7 +316,7 @@ public function checkRequirements() { } /** @var \Drupal\migrate\Entity\MigrationInterface[] $required_migrations */ - $required_migrations = \Drupal::entityManager()->getStorageController('migration')->loadMultiple($this->requirements); + $required_migrations = \Drupal::entityManager()->getStorage('migration')->loadMultiple($this->requirements); // Check if the dependencies are in good shape. foreach ($required_migrations as $required_migration) { // If the dependent source migration has no IDs then no mappings can diff --git a/core/modules/migrate/lib/Drupal/migrate/MigrationStorageController.php b/core/modules/migrate/lib/Drupal/migrate/MigrationStorage.php similarity index 93% rename from core/modules/migrate/lib/Drupal/migrate/MigrationStorageController.php rename to core/modules/migrate/lib/Drupal/migrate/MigrationStorage.php index 4b9b0ad..73a5f07 100644 --- a/core/modules/migrate/lib/Drupal/migrate/MigrationStorageController.php +++ b/core/modules/migrate/lib/Drupal/migrate/MigrationStorage.php @@ -2,24 +2,24 @@ /** * @file - * Contains \Drupal\migrate\MigrateStorageController. + * Contains \Drupal\migrate\MigrateStorage. */ namespace Drupal\migrate; use Drupal\Component\Graph\Graph; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; /** * Storage controller for migration entities. */ -class MigrationStorageController extends ConfigStorageController implements MigrateBuildDependencyInterface { +class MigrationStorage extends ConfigEntityStorage implements MigrateBuildDependencyInterface { /** * {@inheritdoc} */ public function buildDependencyMigration(array $migrations, array $dynamic_ids) { - // Migration dependencies defined in the migration storage controller can be + // Migration dependencies defined in the migration storage can be // soft dependencies: if a soft dependency does not run, the current // migration is still OK to go. This is indicated by adding ": false" // (without quotes) after the name of the dependency. Hard dependencies diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/Entity.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/Entity.php index e82f730..17b39ec 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/Entity.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/Entity.php @@ -7,7 +7,7 @@ namespace Drupal\migrate\Plugin\migrate\destination; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\migrate\Entity\MigrationInterface; use Drupal\migrate\Row; @@ -22,11 +22,11 @@ abstract class Entity extends DestinationBase implements ContainerFactoryPluginInterface { /** - * The entity storage controller. + * The entity storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The list of the bundles of this entity type. @@ -46,14 +46,14 @@ * The plugin implementation definition. * @param MigrationInterface $migration * The migration. - * @param EntityStorageControllerInterface $storage_controller - * The storage controller for this entity type. + * @param EntityStorageInterface $storage + * The storage for this entity type. * @param array $bundles * The list of bundles this entity type has. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageControllerInterface $storage_controller, array $bundles) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles) { parent::__construct($configuration, $plugin_id, $plugin_definition, $migration); - $this->storageController = $storage_controller; + $this->storage = $storage; $this->bundles = $bundles; } @@ -67,7 +67,7 @@ public static function create(ContainerInterface $container, array $configuratio $plugin_id, $plugin_definition, $migration, - $container->get('entity.manager')->getStorageController($entity_type_id), + $container->get('entity.manager')->getStorage($entity_type_id), array_keys($container->get('entity.manager')->getBundleInfo($entity_type_id)) ); } @@ -107,7 +107,7 @@ public function fields(MigrationInterface $migration = NULL) { */ protected function getEntity(Row $row, array $old_destination_id_values) { $entity_id = $old_destination_id_values ? reset($old_destination_id_values) : $row->getDestinationProperty($this->getKey('id')); - if (!empty($entity_id) && ($entity = $this->storageController->load($entity_id))) { + if (!empty($entity_id) && ($entity = $this->storage->load($entity_id))) { $this->updateEntity($entity, $row); } else { @@ -119,7 +119,7 @@ protected function getEntity(Row $row, array $old_destination_id_values) { $values[$bundle_key] = reset($this->bundles); } } - $entity = $this->storageController->create($values); + $entity = $this->storage->create($values); $entity->enforceIsNew(); } return $entity; @@ -137,7 +137,7 @@ protected function getEntity(Row $row, array $old_destination_id_values) { * @see \Drupal\Core\Entity\EntityTypeInterface::getKeys() */ protected function getKey($key) { - return $this->storageController->getEntityType()->getKey($key); + return $this->storage->getEntityType()->getKey($key); } } diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityComment.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityComment.php index cf3faba..3549d50 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityComment.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityComment.php @@ -7,7 +7,7 @@ namespace Drupal\migrate\Plugin\migrate\destination; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\KeyValueStore\StateInterface; use Drupal\field\FieldInfo; use Drupal\migrate\Entity\MigrationInterface; @@ -40,8 +40,8 @@ class EntityComment extends EntityContentBase { * The plugin implementation definition. * @param MigrationInterface $migration * The migration. - * @param EntityStorageControllerInterface $storage_controller - * The storage controller for this entity type. + * @param EntityStorageInterface $storage + * The storage for this entity type. * @param array $bundles * The list of bundles this entity type has. * @param \Drupal\migrate\Plugin\MigratePluginManager $plugin_manager @@ -51,8 +51,8 @@ class EntityComment extends EntityContentBase { * @param \Drupal\Core\KeyValueStore\StateInterface $state * The state storage object. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageControllerInterface $storage_controller, array $bundles, MigratePluginManager $plugin_manager, FieldInfo $field_info, StateInterface $state) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage_controller, $bundles, $plugin_manager, $field_info); + public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, MigratePluginManager $plugin_manager, FieldInfo $field_info, StateInterface $state) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $plugin_manager, $field_info); $this->state = $state; } @@ -66,7 +66,7 @@ public static function create(ContainerInterface $container, array $configuratio $plugin_id, $plugin_definition, $migration, - $container->get('entity.manager')->getStorageController($entity_type), + $container->get('entity.manager')->getStorage($entity_type), array_keys($container->get('entity.manager')->getBundleInfo($entity_type)), $container->get('plugin.manager.migrate.entity_field'), $container->get('field.info'), diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityContentBase.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityContentBase.php index 70f2624..4feee21 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityContentBase.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityContentBase.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\TypedData\TypedDataInterface; use Drupal\field\FieldInfo; use Drupal\migrate\Entity\MigrationInterface; @@ -38,8 +38,8 @@ class EntityContentBase extends Entity { * The plugin implementation definition. * @param \Drupal\migrate\Entity\MigrationInterface $migration * The migration entity. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The storage controller for this entity type. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The storage for this entity type. * @param array $bundles * The list of bundles this entity type has. * @param \Drupal\migrate\Plugin\MigratePluginManager $plugin_manager @@ -47,8 +47,8 @@ class EntityContentBase extends Entity { * @param \Drupal\Field\FieldInfo $field_info * The field info. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageControllerInterface $storage_controller, array $bundles, MigratePluginManager $plugin_manager, FieldInfo $field_info) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage_controller, $bundles); + public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, MigratePluginManager $plugin_manager, FieldInfo $field_info) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles); $this->migrateEntityFieldPluginManager = $plugin_manager; $this->fieldInfo = $field_info; } @@ -63,7 +63,7 @@ public static function create(ContainerInterface $container, array $configuratio $plugin_id, $plugin_definition, $migration, - $container->get('entity.manager')->getStorageController($entity_type), + $container->get('entity.manager')->getStorage($entity_type), array_keys($container->get('entity.manager')->getBundleInfo($entity_type)), $container->get('plugin.manager.migrate.entity_field'), $container->get('field.info') @@ -74,7 +74,7 @@ public static function create(ContainerInterface $container, array $configuratio * {@inheritdoc} */ public function import(Row $row, array $old_destination_id_values = array()) { - if ($all_instances = $this->fieldInfo->getInstances($this->storageController->getEntityTypeId())) { + if ($all_instances = $this->fieldInfo->getInstances($this->storage->getEntityTypeId())) { /** @var \Drupal\Field\Entity\FieldInstanceConfig[] $instances */ $instances = array(); if ($bundle_key = $this->getKey('bundle')) { diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityFile.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityFile.php index 4c8a1f1..e336f69 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityFile.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityFile.php @@ -7,7 +7,7 @@ namespace Drupal\migrate\Plugin\migrate\destination; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\field\FieldInfo; use Drupal\migrate\Entity\MigrationInterface; use Drupal\migrate\Plugin\MigratePluginManager; @@ -23,14 +23,14 @@ class EntityFile extends EntityContentBase { /** * {@inheritdoc} */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageControllerInterface $storage_controller, array $bundles, MigratePluginManager $plugin_manager, FieldInfo $field_info) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, MigratePluginManager $plugin_manager, FieldInfo $field_info) { $configuration += array( 'source_base_path' => '', 'source_path_property' => 'filepath', 'destination_path_property' => 'uri', 'move' => FALSE, ); - parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage_controller, $bundles, $plugin_manager, $field_info); + parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $plugin_manager, $field_info); } /** @@ -42,7 +42,7 @@ public function import(Row $row, array $old_destination_id_values = array()) { $replace = FILE_EXISTS_REPLACE; if (!empty($this->configuration['rename'])) { $entity_id = $row->getDestinationProperty($this->getKey('id')); - if (!empty($entity_id) && ($entity = $this->storageController->load($entity_id))) { + if (!empty($entity_id) && ($entity = $this->storage->load($entity_id))) { $replace = FILE_EXISTS_RENAME; } } diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityRevision.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityRevision.php index 5476def..dfc4b2d 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityRevision.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityRevision.php @@ -38,12 +38,12 @@ protected static function getEntityTypeId($plugin_id) { */ protected function getEntity(Row $row, array $old_destination_id_values) { $revision_id = $old_destination_id_values ? reset($old_destination_id_values) : $row->getDestinationProperty($this->getKey('revision')); - if (!empty($revision_id) && ($entity = $this->storageController->loadRevision($revision_id))) { + if (!empty($revision_id) && ($entity = $this->storage->loadRevision($revision_id))) { $entity->setNewRevision(FALSE); } else { $entity_id = $row->getDestinationProperty($this->getKey('id')); - $entity = $this->storageController->load($entity_id); + $entity = $this->storage->load($entity_id); $entity->enforceIsNew(FALSE); $entity->setNewRevision(TRUE); $entity->keepNewRevisionId(TRUE); diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityUser.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityUser.php index d218b4b..24ff386 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityUser.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/destination/EntityUser.php @@ -7,7 +7,7 @@ namespace Drupal\migrate\Plugin\migrate\destination; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Password\PasswordInterface; use Drupal\field\FieldInfo; use Drupal\migrate\Entity\MigrationInterface; @@ -42,8 +42,8 @@ class EntityUser extends EntityContentBase { * The plugin implementation definition. * @param MigrationInterface $migration * The migration. - * @param EntityStorageControllerInterface $storage_controller - * The storage controller for this entity type. + * @param EntityStorageInterface $storage + * The storage for this entity type. * @param array $bundles * The list of bundles this entity type has. * @param \Drupal\migrate\Plugin\MigratePluginManager $plugin_manager @@ -53,8 +53,8 @@ class EntityUser extends EntityContentBase { * @param \Drupal\Core\Password\PasswordInterface $password * The password service. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageControllerInterface $storage_controller, array $bundles, MigratePluginManager $plugin_manager, FieldInfo $field_info, PasswordInterface $password) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage_controller, $bundles, $plugin_manager, $field_info); + public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, MigratePluginManager $plugin_manager, FieldInfo $field_info, PasswordInterface $password) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles, $plugin_manager, $field_info); if (isset($configuration['md5_passwords'])) { $this->password = $password; } @@ -70,7 +70,7 @@ public static function create(ContainerInterface $container, array $configuratio $plugin_id, $plugin_definition, $migration, - $container->get('entity.manager')->getStorageController($entity_type), + $container->get('entity.manager')->getStorage($entity_type), array_keys($container->get('entity.manager')->getBundleInfo($entity_type)), $container->get('plugin.manager.migrate.entity_field'), $container->get('field.info'), diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/Migration.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/Migration.php index e64e93e..8ba2c45 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/Migration.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/Migration.php @@ -8,7 +8,7 @@ namespace Drupal\migrate\Plugin\migrate\process; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\MigrateSkipRowException; @@ -35,16 +35,16 @@ class Migration extends ProcessPluginBase implements ContainerFactoryPluginInter protected $processPluginManager; /** - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $migrationStorageController; + protected $migrationStorage; /** * {@inheritdoc} */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageControllerInterface $storage_controller, MigratePluginManager $process_plugin_manager) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, MigratePluginManager $process_plugin_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->migrationStorageController = $storage_controller; + $this->migrationStorage = $storage; $this->migration = $migration; $this->processPluginManager = $process_plugin_manager; } @@ -58,7 +58,7 @@ public static function create(ContainerInterface $container, array $configuratio $plugin_id, $plugin_definition, $migration, - $container->get('entity.manager')->getStorageController('migration'), + $container->get('entity.manager')->getStorage('migration'), $container->get('plugin.manager.migrate.process') ); } @@ -78,7 +78,7 @@ public function transform($value, MigrateExecutable $migrate_executable, Row $ro } $self = FALSE; /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ - $migrations = $this->migrationStorageController->loadMultiple($migration_ids); + $migrations = $this->migrationStorage->loadMultiple($migration_ids); $destination_ids = NULL; $source_id_values = array(); foreach ($migrations as $migration_id => $migration) { diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrationStorageController.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrationStorage.php similarity index 93% rename from core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrationStorageController.php rename to core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrationStorage.php index 08e5d63..5e65cf1 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrationStorageController.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/MigrationStorage.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\migrate_drupal\MigrateStorageController. + * Contains \Drupal\migrate_drupal\MigrateStorage. */ namespace Drupal\migrate_drupal; @@ -10,12 +10,12 @@ use Drupal\Component\Utility\String; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageException; -use Drupal\migrate\MigrationStorageController as BaseMigrationStorageController; +use Drupal\migrate\MigrationStorage as BaseMigrationStorage; /** * Storage controller for migration entities. */ -class MigrationStorageController extends BaseMigrationStorageController { +class MigrationStorage extends BaseMigrationStorage { /** * {@inheritdoc} diff --git a/core/modules/migrate_drupal/migrate_drupal.module b/core/modules/migrate_drupal/migrate_drupal.module index 726222d..7b85d80 100644 --- a/core/modules/migrate_drupal/migrate_drupal.module +++ b/core/modules/migrate_drupal/migrate_drupal.module @@ -7,5 +7,5 @@ function migrate_drupal_entity_type_alter(array &$entity_types) { /** @var \Drupal\Core\Config\Entity\ConfigEntityType[] $entity_types */ $entity_types['migration'] ->setClass('Drupal\migrate_drupal\Entity\Migration') - ->setControllerClass('storage', 'Drupal\migrate_drupal\MigrationStorageController'); + ->setControllerClass('storage', 'Drupal\migrate_drupal\MigrationStorage'); } diff --git a/core/modules/node/lib/Drupal/node/Access/NodeRevisionAccessCheck.php b/core/modules/node/lib/Drupal/node/Access/NodeRevisionAccessCheck.php index 353a8fb..9e60cae 100644 --- a/core/modules/node/lib/Drupal/node/Access/NodeRevisionAccessCheck.php +++ b/core/modules/node/lib/Drupal/node/Access/NodeRevisionAccessCheck.php @@ -23,7 +23,7 @@ class NodeRevisionAccessCheck implements AccessInterface { /** * The node storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $nodeStorage; @@ -57,7 +57,7 @@ class NodeRevisionAccessCheck implements AccessInterface { * The database connection. */ public function __construct(EntityManagerInterface $entity_manager, Connection $connection) { - $this->nodeStorage = $entity_manager->getStorageController('node'); + $this->nodeStorage = $entity_manager->getStorage('node'); $this->nodeAccess = $entity_manager->getAccessController('node'); $this->connection = $connection; } diff --git a/core/modules/node/lib/Drupal/node/Controller/NodeController.php b/core/modules/node/lib/Drupal/node/Controller/NodeController.php index 273f441..f9e4d36 100644 --- a/core/modules/node/lib/Drupal/node/Controller/NodeController.php +++ b/core/modules/node/lib/Drupal/node/Controller/NodeController.php @@ -34,7 +34,7 @@ public function addPage() { $content = array(); // Only use node types the user has access to. - foreach ($this->entityManager()->getStorageController('node_type')->loadMultiple() as $type) { + foreach ($this->entityManager()->getStorage('node_type')->loadMultiple() as $type) { if ($this->entityManager()->getAccessController('node')->createAccess($type->type)) { $content[$type->type] = $type; } @@ -65,7 +65,7 @@ public function add(NodeTypeInterface $node_type) { $account = $this->currentUser(); $langcode = $this->moduleHandler()->invoke('language', 'get_default_langcode', array('node', $node_type->type)); - $node = $this->entityManager()->getStorageController('node')->create(array( + $node = $this->entityManager()->getStorage('node')->create(array( 'uid' => $account->id(), 'name' => $account->getUsername() ?: '', 'type' => $node_type->type, @@ -87,7 +87,7 @@ public function add(NodeTypeInterface $node_type) { * An array suitable for drupal_render(). */ public function revisionShow($node_revision) { - $node = $this->entityManager()->getStorageController('node')->loadRevision($node_revision); + $node = $this->entityManager()->getStorage('node')->loadRevision($node_revision); $page = $this->buildPage($node); unset($page['nodes'][$node->id()]['#cache']); @@ -104,7 +104,7 @@ public function revisionShow($node_revision) { * The page title. */ public function revisionPageTitle($node_revision) { - $node = $this->entityManager()->getStorageController('node')->loadRevision($node_revision); + $node = $this->entityManager()->getStorage('node')->loadRevision($node_revision); return $this->t('Revision of %title from %date', array('%title' => $node->label(), '%date' => format_date($node->getRevisionCreationTime()))); } diff --git a/core/modules/node/lib/Drupal/node/Entity/Node.php b/core/modules/node/lib/Drupal/node/Entity/Node.php index da4b174..908f459 100644 --- a/core/modules/node/lib/Drupal/node/Entity/Node.php +++ b/core/modules/node/lib/Drupal/node/Entity/Node.php @@ -8,7 +8,7 @@ namespace Drupal\node\Entity; use Drupal\Core\Entity\ContentEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; use Drupal\Core\Language\Language; @@ -78,8 +78,8 @@ public function getRevisionId() { /** * {@inheritdoc} */ - public function preSaveRevision(EntityStorageControllerInterface $storage_controller, \stdClass $record) { - parent::preSaveRevision($storage_controller, $record); + public function preSaveRevision(EntityStorageInterface $storage, \stdClass $record) { + parent::preSaveRevision($storage, $record); if ($this->newRevision) { // When inserting either a new node or a new node revision, $node->log @@ -106,8 +106,8 @@ public function preSaveRevision(EntityStorageControllerInterface $storage_contro /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); // Update the node access table for this node, but only if it is the // default revision. There's no need to delete existing records if the node @@ -126,8 +126,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::preDelete($storage_controller, $entities); + public static function preDelete(EntityStorageInterface $storage, array $entities) { + parent::preDelete($storage, $entities); // Assure that all nodes deleted are removed from the search index. if (\Drupal::moduleHandler()->moduleExists('search')) { @@ -140,8 +140,8 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $nodes) { - parent::postDelete($storage_controller, $nodes); + public static function postDelete(EntityStorageInterface $storage, array $nodes) { + parent::postDelete($storage, $nodes); \Drupal::service('node.grant_storage')->deleteNodeRecords(array_keys($nodes)); } diff --git a/core/modules/node/lib/Drupal/node/Entity/NodeType.php b/core/modules/node/lib/Drupal/node/Entity/NodeType.php index b187c75..8ca6f72 100644 --- a/core/modules/node/lib/Drupal/node/Entity/NodeType.php +++ b/core/modules/node/lib/Drupal/node/Entity/NodeType.php @@ -10,7 +10,7 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Cache\Cache; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\node\NodeTypeInterface; /** @@ -153,8 +153,8 @@ public function isLocked() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); if (!$update) { // Clear the node type cache, so the new type appears. @@ -194,11 +194,11 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); // Clear the node type cache to reflect the removal. - $storage_controller->resetCache(array_keys($entities)); + $storage->resetCache(array_keys($entities)); foreach ($entities as $entity) { entity_invoke_bundle_hook('delete', 'node', $entity->id()); } @@ -207,8 +207,8 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont /** * {@inheritdoc} */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { - parent::preCreate($storage_controller, $values); + public static function preCreate(EntityStorageInterface $storage, array &$values) { + parent::preCreate($storage, $values); // Ensure default values are set. if (!isset($values['settings']['node'])) { diff --git a/core/modules/node/lib/Drupal/node/Form/DeleteMultiple.php b/core/modules/node/lib/Drupal/node/Form/DeleteMultiple.php index 5f474d5..fada9bb 100644 --- a/core/modules/node/lib/Drupal/node/Form/DeleteMultiple.php +++ b/core/modules/node/lib/Drupal/node/Form/DeleteMultiple.php @@ -35,9 +35,9 @@ class DeleteMultiple extends ConfirmFormBase { protected $tempStoreFactory; /** - * The node storage controller. + * The node storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $manager; @@ -51,7 +51,7 @@ class DeleteMultiple extends ConfirmFormBase { */ public function __construct(TempStoreFactory $temp_store_factory, EntityManagerInterface $manager) { $this->tempStoreFactory = $temp_store_factory; - $this->storageController = $manager->getStorageController('node'); + $this->storage = $manager->getStorage('node'); } /** @@ -118,7 +118,7 @@ public function buildForm(array $form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { if ($form_state['values']['confirm'] && !empty($this->nodes)) { - $this->storageController->delete($this->nodes); + $this->storage->delete($this->nodes); $this->tempStoreFactory->get('node_multiple_delete_confirm')->delete(\Drupal::currentUser()->id()); $count = count($this->nodes); watchdog('content', 'Deleted @count posts.', array('@count' => $count)); diff --git a/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php b/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php index 93148d4..a543f13 100644 --- a/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php +++ b/core/modules/node/lib/Drupal/node/Form/NodeDeleteForm.php @@ -88,7 +88,7 @@ public function getConfirmText() { public function submit(array $form, array &$form_state) { $this->entity->delete(); watchdog('content', '@type: deleted %title.', array('@type' => $this->entity->bundle(), '%title' => $this->entity->label())); - $node_type_storage = $this->entityManager->getStorageController('node_type'); + $node_type_storage = $this->entityManager->getStorage('node_type'); $node_type = $node_type_storage->load($this->entity->bundle())->label(); drupal_set_message(t('@type %title has been deleted.', array('@type' => $node_type, '%title' => $this->entity->label()))); Cache::invalidateTags(array('content' => TRUE)); diff --git a/core/modules/node/lib/Drupal/node/Form/NodeRevisionDeleteForm.php b/core/modules/node/lib/Drupal/node/Form/NodeRevisionDeleteForm.php index 2f78b3c..8890709 100644 --- a/core/modules/node/lib/Drupal/node/Form/NodeRevisionDeleteForm.php +++ b/core/modules/node/lib/Drupal/node/Form/NodeRevisionDeleteForm.php @@ -8,7 +8,7 @@ namespace Drupal\node\Form; use Drupal\Core\Database\Connection; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Form\ConfirmFormBase; use Drupal\node\NodeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -28,14 +28,14 @@ class NodeRevisionDeleteForm extends ConfirmFormBase { /** * The node storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $nodeStorage; /** * The node type storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $nodeTypeStorage; @@ -49,14 +49,14 @@ class NodeRevisionDeleteForm extends ConfirmFormBase { /** * Constructs a new NodeRevisionDeleteForm. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $node_storage + * @param \Drupal\Core\Entity\EntityStorageInterface $node_storage * The node storage. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $node_type_storage + * @param \Drupal\Core\Entity\EntityStorageInterface $node_type_storage * The node type storage. * @param \Drupal\Core\Database\Connection $connection * The database connection. */ - public function __construct(EntityStorageControllerInterface $node_storage, EntityStorageControllerInterface $node_type_storage, Connection $connection) { + public function __construct(EntityStorageInterface $node_storage, EntityStorageInterface $node_type_storage, Connection $connection) { $this->nodeStorage = $node_storage; $this->nodeTypeStorage = $node_type_storage; $this->connection = $connection; @@ -68,8 +68,8 @@ public function __construct(EntityStorageControllerInterface $node_storage, Enti public static function create(ContainerInterface $container) { $entity_manager = $container->get('entity.manager'); return new static( - $entity_manager->getStorageController('node'), - $entity_manager->getStorageController('node_type'), + $entity_manager->getStorage('node'), + $entity_manager->getStorage('node_type'), $container->get('database') ); } diff --git a/core/modules/node/lib/Drupal/node/Form/NodeRevisionRevertForm.php b/core/modules/node/lib/Drupal/node/Form/NodeRevisionRevertForm.php index 86eab4a..b0d717d 100644 --- a/core/modules/node/lib/Drupal/node/Form/NodeRevisionRevertForm.php +++ b/core/modules/node/lib/Drupal/node/Form/NodeRevisionRevertForm.php @@ -7,7 +7,7 @@ namespace Drupal\node\Form; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Form\ConfirmFormBase; use Drupal\node\NodeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -27,17 +27,17 @@ class NodeRevisionRevertForm extends ConfirmFormBase { /** * The node storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $nodeStorage; /** * Constructs a new NodeRevisionRevertForm. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $node_storage + * @param \Drupal\Core\Entity\EntityStorageInterface $node_storage * The node storage. */ - public function __construct(EntityStorageControllerInterface $node_storage) { + public function __construct(EntityStorageInterface $node_storage) { $this->nodeStorage = $node_storage; } @@ -46,7 +46,7 @@ public function __construct(EntityStorageControllerInterface $node_storage) { */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('node') + $container->get('entity.manager')->getStorage('node') ); } diff --git a/core/modules/node/lib/Drupal/node/NodeAccessController.php b/core/modules/node/lib/Drupal/node/NodeAccessController.php index 96204a4..7b85600 100644 --- a/core/modules/node/lib/Drupal/node/NodeAccessController.php +++ b/core/modules/node/lib/Drupal/node/NodeAccessController.php @@ -27,7 +27,7 @@ class NodeAccessController extends EntityAccessController implements NodeAccessC /** * The node grant storage. * - * @var \Drupal\node\NodeGrantStorageControllerInterface + * @var \Drupal\node\NodeGrantStorageInterface */ protected $grantStorage; diff --git a/core/modules/node/lib/Drupal/node/NodeGrantDatabaseStorageInterface.php b/core/modules/node/lib/Drupal/node/NodeGrantDatabaseStorageInterface.php index 42ca2ec..c67025b 100644 --- a/core/modules/node/lib/Drupal/node/NodeGrantDatabaseStorageInterface.php +++ b/core/modules/node/lib/Drupal/node/NodeGrantDatabaseStorageInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\node\NodeGrantStorageControllerInterface. + * Contains \Drupal\node\NodeGrantStorageInterface. */ namespace Drupal\node; diff --git a/core/modules/node/lib/Drupal/node/NodeListBuilder.php b/core/modules/node/lib/Drupal/node/NodeListBuilder.php index d80b6b2..7aa104c 100644 --- a/core/modules/node/lib/Drupal/node/NodeListBuilder.php +++ b/core/modules/node/lib/Drupal/node/NodeListBuilder.php @@ -11,7 +11,7 @@ use Drupal\Core\Datetime\Date; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityListBuilder; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Language\Language; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -35,12 +35,12 @@ class NodeListBuilder extends EntityListBuilder { * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. * @param \Drupal\Core\Datetime\Date $date_service * The date service. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, Date $date_service) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, Date $date_service) { parent::__construct($entity_type, $storage); $this->dateService = $date_service; @@ -52,7 +52,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('date') ); } diff --git a/core/modules/node/lib/Drupal/node/NodeTypeListBuilder.php b/core/modules/node/lib/Drupal/node/NodeTypeListBuilder.php index 681fff4..9dfe695 100644 --- a/core/modules/node/lib/Drupal/node/NodeTypeListBuilder.php +++ b/core/modules/node/lib/Drupal/node/NodeTypeListBuilder.php @@ -10,7 +10,7 @@ use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Routing\UrlGeneratorInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Component\Utility\Xss; @@ -35,12 +35,12 @@ class NodeTypeListBuilder extends ConfigEntityListBuilder { * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator * The url generator service. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, UrlGeneratorInterface $url_generator) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, UrlGeneratorInterface $url_generator) { parent::__construct($entity_type, $storage); $this->urlGenerator = $url_generator; } @@ -51,7 +51,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('url_generator') ); } diff --git a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php index 7dc09d6..443c5cb 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php +++ b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php @@ -231,7 +231,7 @@ public function execute() { ->limit(10) ->execute(); - $node_storage = $this->entityManager->getStorageController('node'); + $node_storage = $this->entityManager->getStorage('node'); $node_render = $this->entityManager->getViewBuilder('node'); foreach ($find as $item) { @@ -254,7 +254,7 @@ public function execute() { ); $results[] = array( 'link' => $node->url('canonical', array('absolute' => TRUE, 'language' => $language)), - 'type' => check_plain($this->entityManager->getStorageController('node_type')->load($node->bundle())->label()), + 'type' => check_plain($this->entityManager->getStorage('node_type')->load($node->bundle())->label()), 'title' => $node->label(), 'user' => drupal_render($username), 'date' => $node->getChangedTime(), @@ -306,7 +306,7 @@ public function updateIndex() { // The indexing throttle should be aware of the number of language variants // of a node. $counter = 0; - $node_storage = $this->entityManager->getStorageController('node'); + $node_storage = $this->entityManager->getStorage('node'); foreach ($node_storage->loadMultiple($nids) as $node) { // Determine when the maximum number of indexable items is reached. $counter += count($node->getTranslationLanguages()); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php index 7ed9f14..b1a8b3f 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php @@ -230,7 +230,7 @@ function testTranslationRendering() { $default_langcode = $this->langcodes[0]; $values[$default_langcode] = $this->getNewEntityValues($default_langcode); $this->entityId = $this->createEntity($values[$default_langcode], $default_langcode); - $node = \Drupal::entityManager()->getStorageController($this->entityTypeId)->load($this->entityId); + $node = \Drupal::entityManager()->getStorage($this->entityTypeId)->load($this->entityId); $node->setPromoted(TRUE); // Create translations. @@ -247,7 +247,7 @@ function testTranslationRendering() { $this->doTestTranslations('node', $values); // Enable the translation language renderer. - $view = \Drupal::entityManager()->getStorageController('view')->load('frontpage'); + $view = \Drupal::entityManager()->getStorage('view')->load('frontpage'); $display = &$view->getDisplay('default'); $display['display_options']['row']['options']['rendering_language'] = 'translation_language_renderer'; $view->save(); diff --git a/core/modules/node/lib/Drupal/node/Tests/Views/FrontPageTest.php b/core/modules/node/lib/Drupal/node/Tests/Views/FrontPageTest.php index 7867334..b1f00ef 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Views/FrontPageTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/Views/FrontPageTest.php @@ -17,11 +17,11 @@ class FrontPageTest extends ViewTestBase { /** - * The entity storage controller for nodes. + * The entity storage for nodes. * - * @var \Drupal\node\NodeStorageController + * @var \Drupal\node\NodeStorage */ - protected $nodeStorageController; + protected $nodeStorage; /** * Modules to enable. @@ -41,7 +41,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - $this->nodeStorageController = $this->container->get('entity.manager')->getStorageController('node'); + $this->nodeStorage = $this->container->get('entity.manager')->getStorage('node'); } /** @@ -76,14 +76,14 @@ public function testFrontPage() { // Test the sticky order. if ($i == 5) { $values['sticky'] = TRUE; - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorage->create($values); $node->save(); // Put the sticky on at the front. array_unshift($expected, array('nid' => $node->id())); } else { $values['sticky'] = FALSE; - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorage->create($values); $node->save(); array_push($expected, array('nid' => $node->id())); } @@ -98,14 +98,14 @@ public function testFrontPage() { $values['title'] = $this->randomName(); $values['status'] = TRUE; $values['promote'] = FALSE; - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorage->create($values); $node->save(); $not_expected_nids[] = $node->id(); $values['promote'] = TRUE; $values['status'] = FALSE; $values['title'] = $this->randomName(); - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorage->create($values); $node->save(); $not_expected_nids[] = $node->id(); @@ -113,7 +113,7 @@ public function testFrontPage() { $values['sticky'] = TRUE; $values['status'] = FALSE; $values['title'] = $this->randomName(); - $node = $this->nodeStorageController->create($values); + $node = $this->nodeStorage->create($values); $node->save(); $not_expected_nids[] = $node->id(); diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php index 844e1a3..ac51b0f 100644 --- a/core/modules/node/node.api.php +++ b/core/modules/node/node.api.php @@ -491,8 +491,8 @@ function hook_node_create(\Drupal\node\NodeInterface $node) { * for all available nodes should be loaded in a single query where possible. * * This hook is invoked during node loading, which is handled by entity_load(), - * via classes Drupal\node\NodeStorageController and - * Drupal\Core\Entity\DatabaseStorageController. After the node information and + * via classes Drupal\node\NodeStorage and + * Drupal\Core\Entity\DatabaseEntityStorage. After the node information and * field values are read from the database or the entity cache, * hook_entity_load() is invoked on all implementing modules, and finally * hook_node_load() is invoked on all implementing modules. diff --git a/core/modules/node/tests/Drupal/node/Tests/Plugin/views/field/NodeBulkFormTest.php b/core/modules/node/tests/Drupal/node/Tests/Plugin/views/field/NodeBulkFormTest.php index 7e1a95e..5deb7c5 100644 --- a/core/modules/node/tests/Drupal/node/Tests/Plugin/views/field/NodeBulkFormTest.php +++ b/core/modules/node/tests/Drupal/node/Tests/Plugin/views/field/NodeBulkFormTest.php @@ -55,8 +55,8 @@ public function testConstructor() { ->will($this->returnValue('user')); $actions[] = $action; - $storage_controller = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); - $storage_controller->expects($this->any()) + $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); + $entity_storage->expects($this->any()) ->method('loadMultiple') ->will($this->returnValue($actions)); @@ -89,7 +89,7 @@ public function testConstructor() { $definition['title'] = ''; $options = array(); - $node_bulk_form = new NodeBulkForm(array(), 'node_bulk_form', $definition, $storage_controller); + $node_bulk_form = new NodeBulkForm(array(), 'node_bulk_form', $definition, $entity_storage); $node_bulk_form->init($executable, $display, $options); $this->assertAttributeEquals(array_slice($actions, 0, -1, TRUE), 'actions', $node_bulk_form); diff --git a/core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php b/core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php index 4c5284f..985494c 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php +++ b/core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php @@ -8,7 +8,7 @@ namespace Drupal\rdf\Entity; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\rdf\RdfMappingInterface; /** @@ -167,7 +167,7 @@ public function calculateDependencies() { if ($bundle_entity_type_id != 'bundle') { // If the target entity type uses entities to manage its bundles then // depend on the bundle entity. - $bundle_entity = \Drupal::entityManager()->getStorageController($bundle_entity_type_id)->load($this->bundle); + $bundle_entity = \Drupal::entityManager()->getStorage($bundle_entity_type_id)->load($this->bundle); $this->addDependency('entity', $bundle_entity->getConfigDependencyName()); } return $this->dependencies; @@ -176,8 +176,8 @@ public function calculateDependencies() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); if (\Drupal::entityManager()->hasController($this->targetEntityType, 'view_builder')) { \Drupal::entityManager()->getViewBuilder($this->targetEntityType)->resetCache(); diff --git a/core/modules/rdf/tests/Drupal/rdf/Tests/RdfMappingConfigEntityUnitTest.php b/core/modules/rdf/tests/Drupal/rdf/Tests/RdfMappingConfigEntityUnitTest.php index 1572d9c..abe8c07 100644 --- a/core/modules/rdf/tests/Drupal/rdf/Tests/RdfMappingConfigEntityUnitTest.php +++ b/core/modules/rdf/tests/Drupal/rdf/Tests/RdfMappingConfigEntityUnitTest.php @@ -142,14 +142,14 @@ public function testCalculateDependenciesWithEntityBundle() { ->with($this->entityTypeId) ->will($this->returnValue($this->entityType)); - $storage = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); $storage->expects($this->once()) ->method('load') ->with($bundle_id) ->will($this->returnValue($bundle_entity)); $this->entityManager->expects($this->once()) - ->method('getStorageController') + ->method('getStorage') ->with($bundle_entity_type_id) ->will($this->returnValue($storage)); diff --git a/core/modules/responsive_image/lib/Drupal/responsive_image/Entity/ResponsiveImageMapping.php b/core/modules/responsive_image/lib/Drupal/responsive_image/Entity/ResponsiveImageMapping.php index 658ad5d..2220ecf 100644 --- a/core/modules/responsive_image/lib/Drupal/responsive_image/Entity/ResponsiveImageMapping.php +++ b/core/modules/responsive_image/lib/Drupal/responsive_image/Entity/ResponsiveImageMapping.php @@ -86,7 +86,7 @@ public function calculateDependencies() { // @todo Implement toArray() so we do not have reload the // entity since this property is changed in // \Drupal\responsive_image\Entity\ResponsiveImageMapping::save(). - $breakpoint_group = \Drupal::entityManager()->getStorageController('breakpoint_group')->load($this->breakpointGroup); + $breakpoint_group = \Drupal::entityManager()->getStorage('breakpoint_group')->load($this->breakpointGroup); $this->addDependency('entity', $breakpoint_group->getConfigDependencyName()); } return $this->dependencies; diff --git a/core/modules/responsive_image/tests/Drupal/responsive_image/Tests/PictureMappingEntityTest.php b/core/modules/responsive_image/tests/Drupal/responsive_image/Tests/PictureMappingEntityTest.php index f14c2fe..4f32c62 100644 --- a/core/modules/responsive_image/tests/Drupal/responsive_image/Tests/PictureMappingEntityTest.php +++ b/core/modules/responsive_image/tests/Drupal/responsive_image/Tests/PictureMappingEntityTest.php @@ -64,9 +64,9 @@ class ResponsiveImageMappingEntityTest extends UnitTestCase { /** * The breakpoint group storage controller used for testing. * - * @var \Drupal\Core\Config\Entity\ConfigStorageControllerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $breakpointGroupStorageController; + protected $breakpointGroupStorage; /** * {@inheritdoc} @@ -101,16 +101,16 @@ public function setUp() { $this->breakpointGroupId = $this->randomName(9); $this->breakpointGroup = $this->getMock('Drupal\breakpoint\Entity\BreakpointGroup', array(), array(array('id' => $this->breakpointGroupId))); - $this->breakpointGroupStorageController = $this->getMock('\Drupal\Core\Config\Entity\ConfigStorageControllerInterface'); - $this->breakpointGroupStorageController + $this->breakpointGroupStorage = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); + $this->breakpointGroupStorage ->expects($this->any()) ->method('load') ->with($this->breakpointGroupId) ->will($this->returnValue($this->breakpointGroup)); $this->entityManager->expects($this->any()) - ->method('getStorageController') - ->will($this->returnValue($this->breakpointGroupStorageController)); + ->method('getStorage') + ->will($this->returnValue($this->breakpointGroupStorage)); $container = new ContainerBuilder(); $container->set('entity.manager', $this->entityManager); diff --git a/core/modules/search/lib/Drupal/search/Entity/SearchPage.php b/core/modules/search/lib/Drupal/search/Entity/SearchPage.php index c89e5a1..3e1fb70 100644 --- a/core/modules/search/lib/Drupal/search/Entity/SearchPage.php +++ b/core/modules/search/lib/Drupal/search/Entity/SearchPage.php @@ -10,7 +10,7 @@ use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Config\Entity\ConfigEntityInterface; use Drupal\Core\Config\Entity\EntityWithPluginBagInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Component\Plugin\ConfigurablePluginInterface; use Drupal\search\Plugin\SearchIndexingInterface; use Drupal\search\Plugin\SearchPluginBag; @@ -24,7 +24,7 @@ * label = @Translation("Search page"), * controllers = { * "access" = "Drupal\search\SearchPageAccessController", - * "storage" = "Drupal\Core\Config\Entity\ConfigStorageController", + * "storage" = "Drupal\Core\Config\Entity\ConfigEntityStorage", * "list_builder" = "Drupal\search\SearchPageListBuilder", * "form" = { * "add" = "Drupal\search\Form\SearchPageAddForm", @@ -181,8 +181,8 @@ public function toArray() { /** * {@inheritdoc} */ - public function postCreate(EntityStorageControllerInterface $storage_controller) { - parent::postCreate($storage_controller); + public function postCreate(EntityStorageInterface $storage) { + parent::postCreate($storage); // @todo Use self::applyDefaultValue() once https://drupal.org/node/2004756 // is in. @@ -194,16 +194,16 @@ public function postCreate(EntityStorageControllerInterface $storage_controller) /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); $this->routeBuilder()->setRebuildNeeded(); } /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); $search_page_repository = \Drupal::service('search.search_page_repository'); if (!$search_page_repository->isSearchActive()) { diff --git a/core/modules/search/lib/Drupal/search/SearchPageListBuilder.php b/core/modules/search/lib/Drupal/search/SearchPageListBuilder.php index e2c61cd..6d82d20 100644 --- a/core/modules/search/lib/Drupal/search/SearchPageListBuilder.php +++ b/core/modules/search/lib/Drupal/search/SearchPageListBuilder.php @@ -10,7 +10,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\Entity\DraggableListBuilder; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Form\FormInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -48,14 +48,14 @@ class SearchPageListBuilder extends DraggableListBuilder implements FormInterfac * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. * @param \Drupal\search\SearchPluginManager $search_manager * The search plugin manager. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The factory for configuration objects. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, SearchPluginManager $search_manager, ConfigFactoryInterface $config_factory) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, SearchPluginManager $search_manager, ConfigFactoryInterface $config_factory) { parent::__construct($entity_type, $storage); $this->configFactory = $config_factory; $this->searchManager = $search_manager; @@ -67,7 +67,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('plugin.manager.search'), $container->get('config.factory') ); diff --git a/core/modules/search/lib/Drupal/search/SearchPageRepository.php b/core/modules/search/lib/Drupal/search/SearchPageRepository.php index db1e57f..55c27dc 100644 --- a/core/modules/search/lib/Drupal/search/SearchPageRepository.php +++ b/core/modules/search/lib/Drupal/search/SearchPageRepository.php @@ -25,7 +25,7 @@ class SearchPageRepository implements SearchPageRepositoryInterface { /** * The search page storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $storage; @@ -39,7 +39,7 @@ class SearchPageRepository implements SearchPageRepositoryInterface { */ public function __construct(ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager) { $this->configFactory = $config_factory; - $this->storage = $entity_manager->getStorageController('search_page'); + $this->storage = $entity_manager->getStorage('search_page'); } /** diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php index 0cff49d..97030a6 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php @@ -211,7 +211,7 @@ public function testDefaultSearchPageOrdering() { */ public function testMultipleSearchPages() { $this->assertDefaultSearch('node_search', 'The default page is set to the installer default.'); - $search_storage = \Drupal::entityManager()->getStorageController('search_page'); + $search_storage = \Drupal::entityManager()->getStorage('search_page'); $entities = $search_storage->loadMultiple(); $search_storage->delete($entities); $this->assertDefaultSearch(FALSE); diff --git a/core/modules/search/tests/Drupal/search/Tests/SearchPageRepositoryTest.php b/core/modules/search/tests/Drupal/search/Tests/SearchPageRepositoryTest.php index c547251..334f995 100644 --- a/core/modules/search/tests/Drupal/search/Tests/SearchPageRepositoryTest.php +++ b/core/modules/search/tests/Drupal/search/Tests/SearchPageRepositoryTest.php @@ -38,7 +38,7 @@ class SearchPageRepositoryTest extends UnitTestCase { /** * The search page storage. * - * @var \Drupal\Core\Config\Entity\ConfigStorageControllerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $storage; @@ -66,14 +66,14 @@ public static function getInfo() { public function setUp() { $this->query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface'); - $this->storage = $this->getMock('Drupal\Core\Config\Entity\ConfigStorageControllerInterface'); + $this->storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); $this->storage->expects($this->any()) ->method('getQuery') ->will($this->returnValue($this->query)); $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); $entity_manager->expects($this->any()) - ->method('getStorageController') + ->method('getStorage') ->will($this->returnValue($this->storage)); $this->configFactory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface'); diff --git a/core/modules/serialization/lib/Drupal/serialization/Normalizer/EntityNormalizer.php b/core/modules/serialization/lib/Drupal/serialization/Normalizer/EntityNormalizer.php index 5ab0c96..b9b308e 100644 --- a/core/modules/serialization/lib/Drupal/serialization/Normalizer/EntityNormalizer.php +++ b/core/modules/serialization/lib/Drupal/serialization/Normalizer/EntityNormalizer.php @@ -70,7 +70,7 @@ public function denormalize($data, $class, $format = NULL, array $context = arra $data[$bundle_key] = $type; } - return $this->entityManager->getStorageController($context['entity_type'])->create($data); + return $this->entityManager->getStorage($context['entity_type'])->create($data); } } diff --git a/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/EntityNormalizerTest.php b/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/EntityNormalizerTest.php index f162798..968ebfb 100644 --- a/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/EntityNormalizerTest.php +++ b/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/EntityNormalizerTest.php @@ -142,16 +142,16 @@ public function testDenormalizeWithBundle() { 'test_type' => 'test_bundle', ); - $storage_controller = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); - $storage_controller->expects($this->once()) + $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); + $storage->expects($this->once()) ->method('create') ->with($expected_test_data) ->will($this->returnValue($this->getMock('Drupal\Core\Entity\EntityInterface'))); $this->entityManager->expects($this->once()) - ->method('getStorageController') + ->method('getStorage') ->with('test') - ->will($this->returnValue($storage_controller)); + ->will($this->returnValue($storage)); $this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, array('entity_type' => 'test'))); } @@ -180,16 +180,16 @@ public function testDenormalizeWithNoBundle() { ->with('test') ->will($this->returnValue($entity_type)); - $storage_controller = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); - $storage_controller->expects($this->once()) + $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); + $storage->expects($this->once()) ->method('create') ->with($test_data) ->will($this->returnValue($this->getMock('Drupal\Core\Entity\EntityInterface'))); $this->entityManager->expects($this->once()) - ->method('getStorageController') + ->method('getStorage') ->with('test') - ->will($this->returnValue($storage_controller)); + ->will($this->returnValue($storage)); $this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, array('entity_type' => 'test'))); } diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutController.php b/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutController.php index 1ed6f0a..8f3b481 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutController.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutController.php @@ -27,7 +27,7 @@ class ShortcutController extends ControllerBase { * The shortcut add form. */ public function addForm(ShortcutSetInterface $shortcut_set) { - $shortcut = $this->entityManager()->getStorageController('shortcut')->create(array('shortcut_set' => $shortcut_set->id())); + $shortcut = $this->entityManager()->getStorage('shortcut')->create(array('shortcut_set' => $shortcut_set->id())); if ($this->moduleHandler()->moduleExists('language')) { $shortcut->langcode = language_get_default_langcode('shortcut', $shortcut_set->id()); } diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutSetController.php b/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutSetController.php index 2d90342..e63e027 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutSetController.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutSetController.php @@ -36,7 +36,7 @@ public function addShortcutLinkInline(ShortcutSetInterface $shortcut_set, Reques $link = $request->query->get('link'); $name = $request->query->get('name'); if (shortcut_valid_link($link)) { - $shortcut = $this->entityManager()->getStorageController('shortcut')->create(array( + $shortcut = $this->entityManager()->getStorage('shortcut')->create(array( 'title' => $name, 'shortcut_set' => $shortcut_set->id(), 'path' => $link, diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php b/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php index 56d4839..eaf7079 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php @@ -8,7 +8,7 @@ namespace Drupal\shortcut\Entity; use Drupal\Core\Entity\ContentEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; use Drupal\Core\Url; @@ -110,8 +110,8 @@ public function setRouteParams($route_parameters) { /** * {@inheritdoc} */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { - parent::preCreate($storage_controller, $values); + public static function preCreate(EntityStorageInterface $storage, array &$values) { + parent::preCreate($storage, $values); if (!isset($values['shortcut_set'])) { $values['shortcut_set'] = 'default'; @@ -121,8 +121,8 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { - parent::preSave($storage_controller); + public function preSave(EntityStorageInterface $storage) { + parent::preSave($storage); $url = Url::createFromPath($this->path->value); $this->setRouteName($url->getRouteName()); diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php b/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php index f7f400c..f4d5d59 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Entity/ShortcutSet.php @@ -8,7 +8,7 @@ namespace Drupal\shortcut\Entity; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\shortcut\ShortcutSetInterface; /** @@ -18,7 +18,7 @@ * id = "shortcut_set", * label = @Translation("Shortcut set"), * controllers = { - * "storage" = "Drupal\shortcut\ShortcutSetStorageController", + * "storage" = "Drupal\shortcut\ShortcutSetStorage", * "access" = "Drupal\shortcut\ShortcutSetAccessController", * "list_builder" = "Drupal\shortcut\ShortcutSetListBuilder", * "form" = { @@ -60,8 +60,8 @@ class ShortcutSet extends ConfigEntityBase implements ShortcutSetInterface { /** * {@inheritdoc} */ - public function postCreate(EntityStorageControllerInterface $storage_controller) { - parent::postCreate($storage_controller); + public function postCreate(EntityStorageInterface $storage) { + parent::postCreate($storage); // Generate menu-compatible set name. if (!$this->getOriginalId()) { @@ -79,18 +79,18 @@ public function postCreate(EntityStorageControllerInterface $storage_controller) /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::preDelete($storage_controller, $entities); + public static function preDelete(EntityStorageInterface $storage, array $entities) { + parent::preDelete($storage, $entities); foreach ($entities as $entity) { - $storage_controller->deleteAssignedShortcutSets($entity); + $storage->deleteAssignedShortcutSets($entity); // Next, delete the shortcuts for this set. $shortcut_ids = \Drupal::entityQuery('shortcut') ->condition('shortcut_set', $entity->id(), '=') ->execute(); - $controller = \Drupal::entityManager()->getStorageController('shortcut'); + $controller = \Drupal::entityManager()->getStorage('shortcut'); $entities = $controller->loadMultiple($shortcut_ids); $controller->delete($entities); } @@ -113,7 +113,7 @@ public function resetLinkWeights() { * {@inheritdoc} */ public function getShortcuts() { - return \Drupal::entityManager()->getStorageController('shortcut')->loadByProperties(array('shortcut_set' => $this->id())); + return \Drupal::entityManager()->getStorage('shortcut')->loadByProperties(array('shortcut_set' => $this->id())); } } diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php index 0b97ded..504b81e 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php @@ -8,7 +8,7 @@ namespace Drupal\shortcut\Form; use Drupal\Core\Entity\EntityConfirmFormBase; -use Drupal\shortcut\ShortcutSetStorageControllerInterface; +use Drupal\shortcut\ShortcutSetStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Database\Connection; @@ -25,18 +25,18 @@ class ShortcutSetDeleteForm extends EntityConfirmFormBase { protected $database; /** - * The shortcut storage controller. + * The shortcut storage. * - * @var \Drupal\shortcut\ShortcutSetStorageControllerInterface + * @var \Drupal\shortcut\ShortcutSetStorageInterface */ - protected $storageController; + protected $storage; /** * Constructs a ShortcutSetDeleteForm object. */ - public function __construct(Connection $database, ShortcutSetStorageControllerInterface $storage_controller) { + public function __construct(Connection $database, ShortcutSetStorageInterface $storage) { $this->database = $database; - $this->storageController = $storage_controller; + $this->storage = $storage; } /** @@ -45,7 +45,7 @@ public function __construct(Connection $database, ShortcutSetStorageControllerIn public static function create(ContainerInterface $container) { return new static( $container->get('database'), - $container->get('entity.manager')->getStorageController('shortcut_set') + $container->get('entity.manager')->getStorage('shortcut_set') ); } @@ -81,7 +81,7 @@ public function getConfirmText() { public function buildForm(array $form, array &$form_state) { // Find out how many users are directly assigned to this shortcut set, and // make a message. - $number = $this->storageController->countAssignedUsers($this->entity); + $number = $this->storage->countAssignedUsers($this->entity); $info = ''; if ($number) { $info .= '

' . format_plural($number, diff --git a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutAccessController.php b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutAccessController.php index 45d3731..402aca7 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutAccessController.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutAccessController.php @@ -20,9 +20,9 @@ class ShortcutAccessController extends EntityAccessController implements EntityControllerInterface { /** - * The shortcut_set storage controller. + * The shortcut_set storage. * - * @var \Drupal\shortcut\ShortcutSetStorageController + * @var \Drupal\shortcut\ShortcutSetStorage */ protected $shortcutSetStorage; @@ -31,10 +31,10 @@ class ShortcutAccessController extends EntityAccessController implements EntityC * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\shortcut\ShortcutSetStorageController $shortcut_set_storage - * The shortcut_set storage controller. + * @param \Drupal\shortcut\ShortcutSetStorage $shortcut_set_storage + * The shortcut_set storage. */ - public function __construct(EntityTypeInterface $entity_type, ShortcutSetStorageController $shortcut_set_storage) { + public function __construct(EntityTypeInterface $entity_type, ShortcutSetStorage $shortcut_set_storage) { parent::__construct($entity_type); $this->shortcutSetStorage = $shortcut_set_storage; } @@ -45,7 +45,7 @@ public function __construct(EntityTypeInterface $entity_type, ShortcutSetStorage public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController('shortcut_set') + $container->get('entity.manager')->getStorage('shortcut_set') ); } diff --git a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorage.php similarity index 83% rename from core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php rename to core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorage.php index 5d82768..ea723d6 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageController.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorage.php @@ -2,17 +2,17 @@ /** * @file - * Contains \Drupal\shortcut\ShortcutSetStorageController. + * Contains \Drupal\shortcut\ShortcutSetStorage. */ namespace Drupal\shortcut; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; /** - * Defines a storage controller for shortcut_set entities. + * Defines a storage for shortcut_set entities. */ -class ShortcutSetStorageController extends ConfigStorageController implements ShortcutSetStorageControllerInterface { +class ShortcutSetStorage extends ConfigEntityStorage implements ShortcutSetStorageInterface { /** * {@inheritdoc} diff --git a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageControllerInterface.php b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageInterface.php similarity index 89% rename from core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageControllerInterface.php rename to core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageInterface.php index 2fb8261..11af402 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageControllerInterface.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetStorageInterface.php @@ -2,17 +2,17 @@ /** * @file - * Contains \Drupal\shortcut\ShortcutSetStorageControllerInterface. + * Contains \Drupal\shortcut\ShortcutSetStorageInterface. */ namespace Drupal\shortcut; -use Drupal\Core\Config\Entity\ConfigStorageControllerInterface; +use Drupal\Core\Config\Entity\ConfigEntityStorageInterface; /** * Defines a common interface for shortcut entity controller classes. */ -interface ShortcutSetStorageControllerInterface extends ConfigStorageControllerInterface { +interface ShortcutSetStorageInterface extends ConfigEntityStorageInterface { /** * Assigns a user to a particular shortcut set. diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php index 9d39537..2a31535 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php @@ -31,7 +31,7 @@ function testShortcutSetAdd() { 'id' => strtolower($this->randomName()), ); $this->drupalPostForm(NULL, $edit, t('Save')); - $new_set = $this->container->get('entity.manager')->getStorageController('shortcut_set')->load($edit['id']); + $new_set = $this->container->get('entity.manager')->getStorage('shortcut_set')->load($edit['id']); $this->assertIdentical($new_set->id(), $edit['id'], 'Successfully created a shortcut set.'); $this->drupalGet('user/' . $this->admin_user->id() . '/shortcuts'); $this->assertText($new_set->label(), 'Generated shortcut set was listed as a choice on the user account page.'); diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php index 9dc04dc..de9e110 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php @@ -111,7 +111,7 @@ function generateShortcutSet($label = '', $id = NULL) { */ function getShortcutInformation(ShortcutSetInterface $set, $key) { $info = array(); - \Drupal::entityManager()->getStorageController('shortcut')->resetCache(); + \Drupal::entityManager()->getStorage('shortcut')->resetCache(); foreach ($set->getShortcuts() as $shortcut) { $info[] = $shortcut->{$key}->value; } diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 95dd6de..62c80ab 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -159,7 +159,7 @@ function shortcut_set_load($id) { */ function shortcut_set_assign_user($shortcut_set, $account) { \Drupal::entityManager() - ->getStorageController('shortcut_set') + ->getStorage('shortcut_set') ->assignUser($shortcut_set, $account); } @@ -178,7 +178,7 @@ function shortcut_set_assign_user($shortcut_set, $account) { */ function shortcut_set_unassign_user($account) { return (bool) \Drupal::entityManager() - ->getStorageController('shortcut_set') + ->getStorage('shortcut_set') ->unassignUser($account); } @@ -207,7 +207,7 @@ function shortcut_current_displayed_set($account = NULL) { // If none was found, try to find a shortcut set that is explicitly assigned // to this user. $shortcut_set_name = \Drupal::entityManager() - ->getStorageController('shortcut_set') + ->getStorage('shortcut_set') ->getAssignedToUser($account); if ($shortcut_set_name) { $shortcut_set = shortcut_set_load($shortcut_set_name); @@ -314,7 +314,7 @@ function shortcut_renderable_links($shortcut_set = NULL) { $shortcut_set = shortcut_current_displayed_set(); } - $shortcuts = \Drupal::entityManager()->getStorageController('shortcut')->loadByProperties(array('shortcut_set' => $shortcut_set->id())); + $shortcuts = \Drupal::entityManager()->getStorage('shortcut')->loadByProperties(array('shortcut_set' => $shortcut_set->id())); foreach ($shortcuts as $shortcut) { $links[] = array( 'title' => $shortcut->label(), @@ -377,7 +377,7 @@ function shortcut_preprocess_page(&$variables) { $shortcut_set = shortcut_current_displayed_set(); // Check if $link is already a shortcut and set $link_mode accordingly. - $shortcuts = \Drupal::entityManager()->getStorageController('shortcut')->loadByProperties(array('shortcut_set' => $shortcut_set->id())); + $shortcuts = \Drupal::entityManager()->getStorage('shortcut')->loadByProperties(array('shortcut_set' => $shortcut_set->id())); foreach ($shortcuts as $shortcut) { if ($shortcut->getRouteName() == $url->getRouteName() && $shortcut->getRouteParams() == $url->getRouteParameters()) { $shortcut_id = $shortcut->id(); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 8efa40a..2476608 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -207,7 +207,7 @@ function __construct($test_id = NULL) { */ function drupalGetNodeByTitle($title, $reset = FALSE) { if ($reset) { - \Drupal::entityManager()->getStorageController('node')->resetCache(); + \Drupal::entityManager()->getStorage('node')->resetCache(); } $nodes = entity_load_multiple_by_properties('node', array('title' => $title)); // Load the first node returned from the database. diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index ab25a74..3c7a344 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -134,8 +134,8 @@ function hook_entity_type_build(array &$entity_types) { function hook_entity_type_alter(array &$entity_types) { /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ // Set the controller class for nodes to an alternate implementation of the - // Drupal\Core\Entity\EntityStorageControllerInterface interface. - $entity_types['node']->setStorageClass('Drupal\mymodule\MyCustomNodeStorageController'); + // Drupal\Core\Entity\EntityStorageInterface interface. + $entity_types['node']->setStorageClass('Drupal\mymodule\MyCustomNodeStorage'); } /** diff --git a/core/modules/system/lib/Drupal/system/Controller/SystemController.php b/core/modules/system/lib/Drupal/system/Controller/SystemController.php index 361f716..421791f 100644 --- a/core/modules/system/lib/Drupal/system/Controller/SystemController.php +++ b/core/modules/system/lib/Drupal/system/Controller/SystemController.php @@ -108,7 +108,7 @@ public function overview() { ->condition('link_path', 'admin/config') ->condition('module', 'system'); $result = $query->execute(); - $menu_link_storage = $this->entityManager()->getStorageController('menu_link'); + $menu_link_storage = $this->entityManager()->getStorage('menu_link'); if ($system_link = $menu_link_storage->loadMultiple($result)) { $system_link = reset($system_link); $query = $this->queryFactory->get('menu_link') diff --git a/core/modules/system/lib/Drupal/system/DateFormatListBuilder.php b/core/modules/system/lib/Drupal/system/DateFormatListBuilder.php index be83cd9..076a27c 100644 --- a/core/modules/system/lib/Drupal/system/DateFormatListBuilder.php +++ b/core/modules/system/lib/Drupal/system/DateFormatListBuilder.php @@ -11,7 +11,7 @@ use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Datetime\Date; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -34,12 +34,12 @@ class DateFormatListBuilder extends ConfigEntityListBuilder { * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. * @param \Drupal\Core\Datetime\Date $date_service * The date service. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, Date $date_service) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, Date $date_service) { parent::__construct($entity_type, $storage); $this->dateService = $date_service; @@ -51,7 +51,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('date') ); } diff --git a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php index 21d8035..fabab0e 100644 --- a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php +++ b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php @@ -9,7 +9,7 @@ use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Datetime\DrupalDateTime; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\system\DateFormatInterface; /** diff --git a/core/modules/system/lib/Drupal/system/Entity/Menu.php b/core/modules/system/lib/Drupal/system/Entity/Menu.php index 8dadc1c..4b6cee5 100644 --- a/core/modules/system/lib/Drupal/system/Entity/Menu.php +++ b/core/modules/system/lib/Drupal/system/Entity/Menu.php @@ -9,7 +9,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\system\MenuInterface; /** @@ -84,8 +84,8 @@ public function isLocked() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); Cache::invalidateTags(array('menu' => $this->id())); } @@ -93,8 +93,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); Cache::invalidateTags(array('menu' => array_keys($entities))); } diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php index ac94508..8e987bc 100644 --- a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php +++ b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php @@ -9,7 +9,7 @@ use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\ReplaceCommand; -use Drupal\Core\Config\Entity\ConfigStorageControllerInterface; +use Drupal\Core\Config\Entity\ConfigEntityStorageInterface; use Drupal\Core\Datetime\Date; use Drupal\Core\Language\Language; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -36,9 +36,9 @@ protected $dateService; /** - * The date format storage controller. + * The date format storage. * - * @var \Drupal\Core\Config\Entity\ConfigStorageControllerInterface + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface */ protected $dateFormatStorage; @@ -47,10 +47,10 @@ * * @param \Drupal\Core\Datetime\Date $date_service * The date service. - * @param \Drupal\Core\Config\Entity\ConfigStorageControllerInterface $date_format_storage - * The date format storage controller. + * @param \Drupal\Core\Config\Entity\ConfigEntityStorageInterface $date_format_storage + * The date format storage. */ - public function __construct(Date $date_service, ConfigStorageControllerInterface $date_format_storage) { + public function __construct(Date $date_service, ConfigEntityStorageInterface $date_format_storage) { $date = new DrupalDateTime(); $this->patternType = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP; @@ -64,7 +64,7 @@ public function __construct(Date $date_service, ConfigStorageControllerInterface public static function create(ContainerInterface $container) { return new static( $container->get('date'), - $container->get('entity.manager')->getStorageController('date_format') + $container->get('entity.manager')->getStorage('date_format') ); } diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php index 7b5d257..4c69bc7 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php @@ -229,7 +229,7 @@ protected function buildRow(array $modules, Extension $module, $distribution) { $result = $this->queryFactory->get('menu_link') ->condition('route_name', $module->info['configure']) ->execute(); - $menu_items = $this->entityManager->getStorageController('menu_link')->loadMultiple($result); + $menu_items = $this->entityManager->getStorage('menu_link')->loadMultiple($result); $item = reset($menu_items); $row['links']['configure'] = array( '#type' => 'link', diff --git a/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php b/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php index 18262f2..dce4edc 100644 --- a/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php +++ b/core/modules/system/lib/Drupal/system/PathBasedBreadcrumbBuilder.php @@ -40,9 +40,9 @@ class PathBasedBreadcrumbBuilder extends BreadcrumbBuilderBase { protected $accessManager; /** - * The menu storage controller. + * The menu storage. * - * @var \Drupal\Core\Config\Entity\ConfigStorageControllerInterface + * @var \Drupal\Core\Config\Entity\ConfigEntityStorageInterface */ protected $menuStorage; @@ -95,7 +95,7 @@ class PathBasedBreadcrumbBuilder extends BreadcrumbBuilderBase { public function __construct(Request $request, EntityManagerInterface $entity_manager, AccessManager $access_manager, RequestMatcherInterface $router, InboundPathProcessorInterface $path_processor, ConfigFactoryInterface $config_factory, TitleResolverInterface $title_resolver) { $this->request = $request; $this->accessManager = $access_manager; - $this->menuStorage = $entity_manager->getStorageController('menu'); + $this->menuStorage = $entity_manager->getStorage('menu'); $this->router = $router; $this->pathProcessor = $path_processor; $this->config = $config_factory->get('system.site'); diff --git a/core/modules/system/lib/Drupal/system/Plugin/Derivative/SystemMenuBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Derivative/SystemMenuBlock.php index 72a4c49..c09eb10 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Derivative/SystemMenuBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Derivative/SystemMenuBlock.php @@ -8,7 +8,7 @@ namespace Drupal\system\Plugin\Derivative; use Drupal\Component\Plugin\Derivative\DerivativeBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,17 +22,17 @@ class SystemMenuBlock extends DerivativeBase implements ContainerDerivativeInter /** * The menu storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $menuStorage; /** * Constructs new SystemMenuBlock. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $menu_storage + * @param \Drupal\Core\Entity\EntityStorageInterface $menu_storage * The menu storage. */ - public function __construct(EntityStorageControllerInterface $menu_storage) { + public function __construct(EntityStorageInterface $menu_storage) { $this->menuStorage = $menu_storage; } @@ -41,7 +41,7 @@ public function __construct(EntityStorageControllerInterface $menu_storage) { */ public static function create(ContainerInterface $container, $base_plugin_id) { return new static( - $container->get('entity.manager')->getStorageController('menu') + $container->get('entity.manager')->getStorage('menu') ); } diff --git a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkForm.php b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkForm.php index 0968488..d4206c3 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkForm.php +++ b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkForm.php @@ -7,7 +7,7 @@ namespace Drupal\system\Plugin\views\field; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\Plugin\views\style\Table; @@ -23,9 +23,9 @@ class BulkForm extends FieldPluginBase { /** - * The action storage controller. + * The action storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $actionStorage; @@ -45,10 +45,10 @@ class BulkForm extends FieldPluginBase { * The plugin ID for the plugin instance. * @param array $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The action storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The action storage. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageControllerInterface $storage) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->actionStorage = $storage; @@ -58,7 +58,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity.manager')->getStorageController('action')); + return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity.manager')->getStorage('action')); } /** diff --git a/core/modules/system/lib/Drupal/system/SystemManager.php b/core/modules/system/lib/Drupal/system/SystemManager.php index eb14718..506e78c 100644 --- a/core/modules/system/lib/Drupal/system/SystemManager.php +++ b/core/modules/system/lib/Drupal/system/SystemManager.php @@ -36,7 +36,7 @@ class SystemManager { /** * The menu link storage. * - * @var \Drupal\menu_link\MenuLinkStorageControllerInterface + * @var \Drupal\menu_link\MenuLinkStorageInterface */ protected $menuLinkStorage; @@ -82,7 +82,7 @@ class SystemManager { public function __construct(ModuleHandlerInterface $module_handler, Connection $database, EntityManagerInterface $entity_manager) { $this->moduleHandler = $module_handler; $this->database = $database; - $this->menuLinkStorage = $entity_manager->getStorageController('menu_link'); + $this->menuLinkStorage = $entity_manager->getStorage('menu_link'); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Action/ActionUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Action/ActionUnitTest.php index 96f2d73..6f97da1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Action/ActionUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Action/ActionUnitTest.php @@ -70,7 +70,7 @@ public function testOperations() { // Create a new unsaved user. $name = $this->randomName(); - $user_storage = $this->container->get('entity.manager')->getStorageController('user'); + $user_storage = $this->container->get('entity.manager')->getStorage('user'); $account = $user_storage->create(array('name' => $name, 'bundle' => 'user')); $loaded_accounts = $user_storage->loadMultiple(); $this->assertEqual(count($loaded_accounts), 0); diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php index c9ac3bd..1a6b758 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php @@ -42,7 +42,7 @@ function setUp() { ->set('timezone.user.configurable', 1) ->save(); $formats = $this->container->get('entity.manager') - ->getStorageController('date_format') + ->getStorage('date_format') ->loadMultiple(array('long', 'medium', 'short')); $formats['long']->setPattern('l, j. F Y - G:i')->save(); $formats['medium']->setPattern('j. F Y - G:i')->save(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Datetime/DateTimePlusIntlTest.php b/core/modules/system/lib/Drupal/system/Tests/Datetime/DateTimePlusIntlTest.php index b38f955..eb21948 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Datetime/DateTimePlusIntlTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Datetime/DateTimePlusIntlTest.php @@ -77,7 +77,7 @@ function testDateTimestampIntl() { $this->assertFalse($php_date->canUseIntl(), 'DateTimePlus object will fallback to use PHP when not provided with country setting.'); $default_formats = $this->container->get('entity.manager') - ->getStorageController('date_format') + ->getStorage('date_format') ->loadMultiple(); foreach ($default_formats as $format) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/BundleConstraintValidatorTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/BundleConstraintValidatorTest.php index b26b0fc..79906f0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/BundleConstraintValidatorTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/BundleConstraintValidatorTest.php @@ -60,14 +60,14 @@ protected function assertValidation($bundle) { ->addConstraint('Bundle', $bundle); // Test the validation. - $node = $this->container->get('entity.manager')->getStorageController('node')->create(array('type' => 'foo')); + $node = $this->container->get('entity.manager')->getStorage('node')->create(array('type' => 'foo')); $typed_data = $this->typedData->create($definition, $node); $violations = $typed_data->validate(); $this->assertEqual($violations->count(), 0, 'Validation passed for correct value.'); // Test the validation when an invalid value is passed. - $page_node = $this->container->get('entity.manager')->getStorageController('node')->create(array('type' => 'baz')); + $page_node = $this->container->get('entity.manager')->getStorage('node')->create(array('type' => 'baz')); $typed_data = $this->typedData->create($definition, $page_node); $violations = $typed_data->validate(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityApiInfoTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityApiInfoTest.php index 93fd554..5d065a0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityApiInfoTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityApiInfoTest.php @@ -54,6 +54,6 @@ function testEntityInfoCacheWatchdog() { \Drupal::moduleHandler()->install(array('entity_cache_test')); $entity_type = \Drupal::state()->get('entity_cache_test'); $this->assertEqual($entity_type->getLabel(), 'Entity Cache Test', 'Entity info label is correct.'); - $this->assertEqual($entity_type->getStorageClass(), 'Drupal\Core\Entity\DatabaseStorageController', 'Entity controller class info is correct.'); + $this->assertEqual($entity_type->getStorageClass(), 'Drupal\Core\Entity\DatabaseEntityStorage', 'Entity controller class info is correct.'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCacheTagsTestBase.php index f1a0c84..fcd0feb 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCacheTagsTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityCacheTagsTestBase.php @@ -82,11 +82,11 @@ public function setUp() { ))->save(); // Reload the entity now that a new field has been added to it. - $storage_controller = $this->container + $storage = $this->container ->get('entity.manager') - ->getStorageController($this->entity->getEntityTypeId()); - $storage_controller->resetCache(); - $this->entity = $storage_controller->load($this->entity->id()); + ->getStorage($this->entity->getEntityTypeId()); + $storage->resetCache(); + $this->entity = $storage->load($this->entity->id()); } // Create a referencing and a non-referencing entity. diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php index 3fa3533..66940a7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php @@ -90,12 +90,12 @@ protected function assertFormCRUD($entity_type) { } /** - * Loads a test entity by name always resetting the storage controller cache. + * Loads a test entity by name always resetting the storage cache. */ protected function loadEntityByName($entity_type, $name) { // Always load the entity from the database to ensure that changes are // correctly picked up. - $this->container->get('entity.manager')->getStorageController($entity_type)->resetCache(); + $this->container->get('entity.manager')->getStorage($entity_type)->resetCache(); return current(entity_load_multiple_by_properties($entity_type, array('name' => $name))); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php index 5adfdde..6ea5549 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php @@ -21,11 +21,11 @@ class EntityQueryAggregateTest extends EntityUnitTestBase { public static $modules = array(); /** - * The entity_test storage controller to create the test entities. + * The entity_test storage to create the test entities. * - * @var \Drupal\entity_test\EntityTestStorageController + * @var \Drupal\entity_test\EntityTestStorage */ - protected $entityStorageController; + protected $entityStorage; /** * The actual query result, to compare later. @@ -52,7 +52,7 @@ public static function getInfo() { public function setUp() { parent::setUp(); - $this->entityStorageController = $this->container->get('entity.manager')->getStorageController('entity_test'); + $this->entityStorage = $this->container->get('entity.manager')->getStorage('entity_test'); $this->factory = $this->container->get('entity.query'); // Add some fieldapi fields to be used in the test. @@ -71,7 +71,7 @@ public function setUp() { ))->save(); } - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorage->create(array( 'id' => 1, 'user_id' => 1, 'field_test_1' => 1, @@ -80,7 +80,7 @@ public function setUp() { $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorage->create(array( 'id' => 2, 'user_id' => 2, 'field_test_1' => 1, @@ -88,7 +88,7 @@ public function setUp() { )); $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorage->create(array( 'id' => 3, 'user_id' => 2, 'field_test_1' => 2, @@ -96,7 +96,7 @@ public function setUp() { )); $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorage->create(array( 'id' => 4, 'user_id' => 2, 'field_test_1' => 2, @@ -104,7 +104,7 @@ public function setUp() { )); $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorage->create(array( 'id' => 5, 'user_id' => 3, 'field_test_1' => 2, @@ -112,7 +112,7 @@ public function setUp() { )); $entity->enforceIsNew(); $entity->save(); - $entity = $this->entityStorageController->create(array( + $entity = $this->entityStorage->create(array( 'id' => 6, 'user_id' => 3, 'field_test_1' => 3, @@ -586,4 +586,3 @@ protected function assertSortedResults($expected) { return $this->assertResults($expected, TRUE); } } - diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php index c01a2e2..70f180e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php @@ -7,7 +7,7 @@ namespace Drupal\system\Tests\Entity; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Language\Language; use Symfony\Component\HttpFoundation\Request; @@ -249,7 +249,7 @@ function testEntityQuery() { $this->assertResult(); $this->queryResults = $this->factory->get('entity_test_mulrev') ->condition("$greetings.value", 'merhaba') - ->age(EntityStorageControllerInterface::FIELD_LOAD_REVISION) + ->age(EntityStorageInterface::FIELD_LOAD_REVISION) ->sort('revision_id') ->execute(); // Bit 2 needs to be set. @@ -279,7 +279,7 @@ function testEntityQuery() { $this->assertIdentical($results, array_slice($assert, 4, 8, TRUE)); $results = $this->factory->get('entity_test_mulrev') ->condition("$greetings.value", 'a', 'ENDS_WITH') - ->age(EntityStorageControllerInterface::FIELD_LOAD_REVISION) + ->age(EntityStorageInterface::FIELD_LOAD_REVISION) ->sort('id') ->execute(); // Now we get everything. diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php index d3b5842..c2d8e6a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php @@ -292,7 +292,7 @@ function testEntityTranslationAPI() { $default_langcode = $this->langcodes[0]; $langcode = $this->langcodes[1]; $entity = $this->entityManager - ->getStorageController('entity_test_mul') + ->getStorage('entity_test_mul') ->create(array('name' => $this->randomName())); $entity->save(); @@ -432,7 +432,7 @@ function testEntityTranslationAPI() { // Check that per-language defaults are properly populated. $entity = $this->reloadEntity($entity); $instance_id = implode('.', array($entity->getEntityTypeId(), $entity->bundle(), $this->field_name)); - $instance = $this->entityManager->getStorageController('field_instance_config')->load($instance_id); + $instance = $this->entityManager->getStorage('field_instance_config')->load($instance_id); $instance->default_value_function = 'entity_test_field_default_value'; $instance->save(); $translation = $entity->addTranslation($langcode2); @@ -459,7 +459,7 @@ function testLanguageFallback() { $langcode2 = $this->langcodes[2]; $entity_type = 'entity_test_mul'; - $controller = $this->entityManager->getStorageController($entity_type); + $controller = $this->entityManager->getStorage($entity_type); $entity = $controller->create(array('langcode' => $default_langcode) + $values[$default_langcode]); $entity->save(); @@ -547,7 +547,7 @@ function testFieldDefinitions() { */ public function testLanguageChange() { $entity_type = 'entity_test_mul'; - $controller = $this->entityManager->getStorageController($entity_type); + $controller = $this->entityManager->getStorage($entity_type); $langcode = $this->langcodes[0]; // check that field languages match entity language regardless of field diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTypeConstraintValidatorTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTypeConstraintValidatorTest.php index 6428ef0..93b60cf 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTypeConstraintValidatorTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTypeConstraintValidatorTest.php @@ -51,7 +51,7 @@ public function testValidation() { ); // Test the validation. - $node = $this->container->get('entity.manager')->getStorageController('node')->create(array('type' => 'page')); + $node = $this->container->get('entity.manager')->getStorage('node')->create(array('type' => 'page')); $typed_data = $this->typedData->create($definition, $node); $violations = $typed_data->validate(); $this->assertEqual($violations->count(), 0, 'Validation passed for correct value.'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php index 8537fbb..99fe76a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php @@ -91,7 +91,7 @@ protected function createUser($values = array(), $permissions = array()) { * The reloaded entity. */ protected function reloadEntity(EntityInterface $entity) { - $controller = $this->entityManager->getStorageController($entity->getEntityTypeId()); + $controller = $this->entityManager->getStorage($entity->getEntityTypeId()); $controller->resetCache(array($entity->id())); return $controller->load($entity->id()); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewBuilderTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewBuilderTest.php index 0379aa7..6ac4a626 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewBuilderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewBuilderTest.php @@ -171,7 +171,7 @@ protected function createTestEntity($entity_type) { 'bundle' => $entity_type, 'name' => $this->randomName(), ); - return $this->container->get('entity.manager')->getStorageController($entity_type)->create($data); + return $this->container->get('entity.manager')->getStorage($entity_type)->create($data); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php index 40613d7..e6d4971 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityViewControllerTest.php @@ -43,7 +43,7 @@ function setUp() { for ($i = 0; $i < 2; $i++) { $random_label = $this->randomName(); $data = array('bundle' => 'entity_test', 'name' => $random_label); - $entity_test = $this->container->get('entity.manager')->getStorageController('entity_test')->create($data); + $entity_test = $this->container->get('entity.manager')->getStorage('entity_test')->create($data); $entity_test->save(); $this->entities[] = $entity_test; } diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php index 8894088..f9b2c9b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php @@ -8,7 +8,7 @@ namespace Drupal\system\Tests\Entity; use Drupal\Core\Database\Database; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\field\FieldException; use Drupal\field\Entity\FieldConfig; use Drupal\system\Tests\Entity\EntityUnitTestBase; @@ -85,8 +85,8 @@ function setUp() { )); $this->instance->save(); - $this->table = FieldableDatabaseStorageController::_fieldTableName($this->field); - $this->revision_table = FieldableDatabaseStorageController::_fieldRevisionTableName($this->field); + $this->table = FieldableDatabaseEntityStorage::_fieldTableName($this->field); + $this->revision_table = FieldableDatabaseEntityStorage::_fieldRevisionTableName($this->field); } /** @@ -94,9 +94,9 @@ function setUp() { */ function testFieldLoad() { $entity_type = $bundle = 'entity_test_rev'; - $storage_controller = $this->container->get('entity.manager')->getStorageController($entity_type); + $storage = $this->container->get('entity.manager')->getStorage($entity_type); - $columns = array('bundle', 'deleted', 'entity_id', 'revision_id', 'delta', 'langcode', FieldableDatabaseStorageController::_fieldColumnName($this->field, 'value')); + $columns = array('bundle', 'deleted', 'entity_id', 'revision_id', 'delta', 'langcode', FieldableDatabaseEntityStorage::_fieldColumnName($this->field, 'value')); // Create an entity with four revisions. $revision_ids = array(); @@ -129,7 +129,7 @@ function testFieldLoad() { // Load every revision and check the values. foreach ($revision_ids as $revision_id) { - $entity = $storage_controller->loadRevision($revision_id); + $entity = $storage->loadRevision($revision_id); foreach ($values[$revision_id] as $delta => $value) { if ($delta < $this->field_cardinality) { $this->assertEqual($entity->{$this->field_name}[$delta]->value, $value); @@ -141,7 +141,7 @@ function testFieldLoad() { } // Load the "current revision" and check the values. - $entity = $storage_controller->load($entity->id()); + $entity = $storage->load($entity->id()); foreach ($values[$revision_id] as $delta => $value) { if ($delta < $this->field_cardinality) { $this->assertEqual($entity->{$this->field_name}[$delta]->value, $value); @@ -157,7 +157,7 @@ function testFieldLoad() { $values = array($bundle, 0, $entity->id(), $entity->getRevisionId(), 0, $unavailable_langcode, mt_rand(1, 127)); db_insert($this->table)->fields($columns)->values($values)->execute(); db_insert($this->revision_table)->fields($columns)->values($values)->execute(); - $entity = $storage_controller->load($entity->id()); + $entity = $storage->load($entity->id()); $this->assertFalse(array_key_exists($unavailable_langcode, $entity->{$this->field_name})); } @@ -259,7 +259,7 @@ function testFieldWrite() { function testLongNames() { // Use one of the longest entity_type names in core. $entity_type = $bundle = 'entity_test_label_callback'; - $storage_controller = $this->container->get('entity.manager')->getStorageController($entity_type); + $storage = $this->container->get('entity.manager')->getStorage($entity_type); // Create two fields with instances, and generate randome values. $name_base = drupal_strtolower($this->randomName(FieldConfig::NAME_MAX_LENGTH - 1)); @@ -285,7 +285,7 @@ function testLongNames() { $entity->save(); // Load the entity back and check the values. - $entity = $storage_controller->load($entity->id()); + $entity = $storage->load($entity->id()); foreach ($field_names as $field_name) { $this->assertEqual($entity->get($field_name)->value, $values[$field_name]); } @@ -353,7 +353,7 @@ function testFieldUpdateFailure() { } // Ensure that the field tables are still there. - foreach (FieldableDatabaseStorageController::_fieldSqlSchema($prior_field) as $table_name => $table_info) { + foreach (FieldableDatabaseEntityStorage::_fieldSqlSchema($prior_field) as $table_name => $table_info) { $this->assertTrue(db_table_exists($table_name), t('Table %table exists.', array('%table' => $table_name))); } } @@ -377,7 +377,7 @@ function testFieldUpdateIndexesWithData() { 'bundle' => $entity_type, )); $instance->save(); - $tables = array(FieldableDatabaseStorageController::_fieldTableName($field), FieldableDatabaseStorageController::_fieldRevisionTableName($field)); + $tables = array(FieldableDatabaseEntityStorage::_fieldTableName($field), FieldableDatabaseEntityStorage::_fieldRevisionTableName($field)); // Verify the indexes we will create do not exist yet. foreach ($tables as $table) { @@ -411,7 +411,7 @@ function testFieldUpdateIndexesWithData() { // Verify that the tables were not dropped in the process. field_cache_clear(); - $entity = $this->container->get('entity.manager')->getStorageController($entity_type)->load(1); + $entity = $this->container->get('entity.manager')->getStorage($entity_type)->load(1); $this->assertEqual($entity->$field_name->value, 'field data', t("Index changes performed without dropping the tables")); } @@ -450,11 +450,11 @@ function testFieldSqlStorageForeignKeys() { $this->assertEqual($schema['foreign keys'][$foreign_key_name]['columns'][$foreign_key_name], 'id', 'Foreign key column name modified after update'); // Verify the SQL schema. - $schemas = FieldableDatabaseStorageController::_fieldSqlSchema($field); - $schema = $schemas[FieldableDatabaseStorageController::_fieldTableName($field)]; + $schemas = FieldableDatabaseEntityStorage::_fieldSqlSchema($field); + $schema = $schemas[FieldableDatabaseEntityStorage::_fieldTableName($field)]; $this->assertEqual(count($schema['foreign keys']), 1, 'There is 1 foreign key in the schema'); $foreign_key = reset($schema['foreign keys']); - $foreign_key_column = FieldableDatabaseStorageController::_fieldColumnName($field, $foreign_key_name); + $foreign_key_column = FieldableDatabaseEntityStorage::_fieldColumnName($field, $foreign_key_name); $this->assertEqual($foreign_key['table'], $foreign_key_name, 'Foreign key table name preserved in the schema'); $this->assertEqual($foreign_key['columns'][$foreign_key_column], 'id', 'Foreign key column name preserved in the schema'); } @@ -504,9 +504,9 @@ public function testTableNames() { 'type' => 'test_field', )); $expected = 'short_entity_type__short_field_name'; - $this->assertEqual(FieldableDatabaseStorageController::_fieldTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldTableName($field), $expected); $expected = 'short_entity_type_revision__short_field_name'; - $this->assertEqual(FieldableDatabaseStorageController::_fieldRevisionTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldRevisionTableName($field), $expected); // Short entity type, long field name $entity_type = 'short_entity_type'; @@ -517,9 +517,9 @@ public function testTableNames() { 'type' => 'test_field', )); $expected = 'short_entity_type__' . substr(hash('sha256', $field->uuid), 0, 10); - $this->assertEqual(FieldableDatabaseStorageController::_fieldTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldTableName($field), $expected); $expected = 'short_entity_type_r__' . substr(hash('sha256', $field->uuid), 0, 10); - $this->assertEqual(FieldableDatabaseStorageController::_fieldRevisionTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldRevisionTableName($field), $expected); // Long entity type, short field name $entity_type = 'long_entity_type_abcdefghijklmnopqrstuvwxyz'; @@ -530,9 +530,9 @@ public function testTableNames() { 'type' => 'test_field', )); $expected = 'long_entity_type_abcdefghijklmnopq__' . substr(hash('sha256', $field->uuid), 0, 10); - $this->assertEqual(FieldableDatabaseStorageController::_fieldTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldTableName($field), $expected); $expected = 'long_entity_type_abcdefghijklmnopq_r__' . substr(hash('sha256', $field->uuid), 0, 10); - $this->assertEqual(FieldableDatabaseStorageController::_fieldRevisionTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldRevisionTableName($field), $expected); // Long entity type and field name. $entity_type = 'long_entity_type_abcdefghijklmnopqrstuvwxyz'; @@ -543,17 +543,17 @@ public function testTableNames() { 'type' => 'test_field', )); $expected = 'long_entity_type_abcdefghijklmnopq__' . substr(hash('sha256', $field->uuid), 0, 10); - $this->assertEqual(FieldableDatabaseStorageController::_fieldTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldTableName($field), $expected); $expected = 'long_entity_type_abcdefghijklmnopq_r__' . substr(hash('sha256', $field->uuid), 0, 10); - $this->assertEqual(FieldableDatabaseStorageController::_fieldRevisionTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldRevisionTableName($field), $expected); // Try creating a second field and check there are no clashes. $field2 = entity_create('field_config', array( 'entity_type' => $entity_type, 'name' => $field_name . '2', 'type' => 'test_field', )); - $this->assertNotEqual(FieldableDatabaseStorageController::_fieldTableName($field), FieldableDatabaseStorageController::_fieldTableName($field2)); - $this->assertNotEqual(FieldableDatabaseStorageController::_fieldRevisionTableName($field), FieldableDatabaseStorageController::_fieldRevisionTableName($field2)); + $this->assertNotEqual(FieldableDatabaseEntityStorage::_fieldTableName($field), FieldableDatabaseEntityStorage::_fieldTableName($field2)); + $this->assertNotEqual(FieldableDatabaseEntityStorage::_fieldRevisionTableName($field), FieldableDatabaseEntityStorage::_fieldRevisionTableName($field2)); // Deleted field. $field = entity_create('field_config', array( @@ -563,9 +563,9 @@ public function testTableNames() { 'deleted' => TRUE, )); $expected = 'field_deleted_data_' . substr(hash('sha256', $field->uuid), 0, 10); - $this->assertEqual(FieldableDatabaseStorageController::_fieldTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldTableName($field), $expected); $expected = 'field_deleted_revision_' . substr(hash('sha256', $field->uuid), 0, 10); - $this->assertEqual(FieldableDatabaseStorageController::_fieldRevisionTableName($field), $expected); + $this->assertEqual(FieldableDatabaseEntityStorage::_fieldRevisionTableName($field), $expected); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldTranslationSqlStorageTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldTranslationSqlStorageTest.php index 45fd696..f014d25 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldTranslationSqlStorageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldTranslationSqlStorageTest.php @@ -8,7 +8,7 @@ namespace Drupal\system\Tests\Entity; use Drupal\Core\Entity\ContentEntityInterface; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\Core\Language\Language; use Drupal\field\Field as FieldService; @@ -31,7 +31,7 @@ public static function getInfo() { public function testFieldSqlStorage() { $entity_type = 'entity_test_mul'; - $controller = $this->entityManager->getStorageController($entity_type); + $controller = $this->entityManager->getStorage($entity_type); $values = array( $this->field_name => $this->randomName(), $this->untranslatable_field_name => $this->randomName(), @@ -93,8 +93,8 @@ protected function assertFieldStorageLangcode(ContentEntityInterface $entity, $m foreach ($fields as $field_name) { $field = FieldService::fieldInfo()->getField($entity_type, $field_name); $tables = array( - FieldableDatabaseStorageController::_fieldTableName($field), - FieldableDatabaseStorageController::_fieldRevisionTableName($field), + FieldableDatabaseEntityStorage::_fieldTableName($field), + FieldableDatabaseEntityStorage::_fieldRevisionTableName($field), ); foreach ($tables as $table) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php index 61f61b5..4d7a735 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php @@ -267,7 +267,7 @@ public function testModuleUninstalledMenuLinks() { \Drupal::service('router.builder')->rebuild(); menu_link_rebuild_defaults(); $result = $menu_link = \Drupal::entityQuery('menu_link')->condition('machine_name', 'menu_test')->execute(); - $menu_links = \Drupal::entityManager()->getStorageController('menu_link')->loadMultiple($result); + $menu_links = \Drupal::entityManager()->getStorage('menu_link')->loadMultiple($result); $this->assertEqual(count($menu_links), 1); $menu_link = reset($menu_links); $this->assertEqual($menu_link->machine_name, 'menu_test'); @@ -275,7 +275,7 @@ public function testModuleUninstalledMenuLinks() { // Uninstall the module and ensure the menu link got removed. \Drupal::moduleHandler()->uninstall(array('menu_test')); $result = $menu_link = \Drupal::entityQuery('menu_link')->condition('machine_name', 'menu_test')->execute(); - $menu_links = \Drupal::entityManager()->getStorageController('menu_link')->loadMultiple($result); + $menu_links = \Drupal::entityManager()->getStorage('menu_link')->loadMultiple($result); $this->assertEqual(count($menu_links), 0); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php index 92de333..5de7b58 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php @@ -111,7 +111,7 @@ public function testPluginLocalTask() { // Test that we we correctly apply the active class to tabs where one of the // request attributes is upcast to an entity object. - $entity = \Drupal::entityManager()->getStorageController('entity_test')->create(array('bundle' => 'test')); + $entity = \Drupal::entityManager()->getStorage('entity_test')->create(array('bundle' => 'test')); $entity->save(); $this->drupalGet('menu-local-task-test-upcasting/1/sub1'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterRebuildTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterRebuildTest.php index 93bb446..dbbb487 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterRebuildTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterRebuildTest.php @@ -52,7 +52,7 @@ public function testMenuRouterRebuildContext() { \Drupal::service('router.builder')->rebuild(); // Check that the language context was not used for building the menu item. - $menu_items = \Drupal::entityManager()->getStorageController('menu_link')->loadByProperties(array('route_name' => 'menu_test.context')); + $menu_items = \Drupal::entityManager()->getStorage('menu_link')->loadByProperties(array('route_name' => 'menu_test.context')); $menu_item = reset($menu_items); $this->assertTrue($menu_item['link_title'] == 'English', 'Config context overrides are ignored when rebuilding menu router items.'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/TreeOutputTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/TreeOutputTest.php index bc80cb5..9befa3e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/TreeOutputTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/TreeOutputTest.php @@ -39,25 +39,25 @@ function setUp() { * Validate the generation of a proper menu tree output. */ function testMenuTreeData() { - $storage_controller = $this->container->get('entity.manager')->getStorageController('menu_link'); + $storage = $this->container->get('entity.manager')->getStorage('menu_link'); // @todo Prettify this tree buildup code, it's very hard to read. $this->tree_data = array( '1'=> array( - 'link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 1, 'hidden' => 0, 'has_children' => 1, 'title' => 'Item 1', 'in_active_trail' => 1, 'access' => 1, 'link_path' => 'a', 'localized_options' => array('attributes' => array('title' =>'')))), + 'link' => $storage->create(array('menu_name' => 'main-menu', 'mlid' => 1, 'hidden' => 0, 'has_children' => 1, 'title' => 'Item 1', 'in_active_trail' => 1, 'access' => 1, 'link_path' => 'a', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array( - '2' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 2, 'hidden' => 0, 'has_children' => 1, 'title' => 'Item 2', 'in_active_trail' => 1, 'access' => 1, 'link_path' => 'a/b', 'localized_options' => array('attributes' => array('title' =>'')))), + '2' => array('link' => $storage->create(array('menu_name' => 'main-menu', 'mlid' => 2, 'hidden' => 0, 'has_children' => 1, 'title' => 'Item 2', 'in_active_trail' => 1, 'access' => 1, 'link_path' => 'a/b', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array( - '3' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 3, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 3', 'in_active_trail' => 0, 'access' => 1, 'link_path' => 'a/b/c', 'localized_options' => array('attributes' => array('title' =>'')))), + '3' => array('link' => $storage->create(array('menu_name' => 'main-menu', 'mlid' => 3, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 3', 'in_active_trail' => 0, 'access' => 1, 'link_path' => 'a/b/c', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array() ), - '4' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 4, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 4', 'in_active_trail' => 0, 'access' => 1, 'link_path' => 'a/b/d', 'localized_options' => array('attributes' => array('title' =>'')))), + '4' => array('link' => $storage->create(array('menu_name' => 'main-menu', 'mlid' => 4, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 4', 'in_active_trail' => 0, 'access' => 1, 'link_path' => 'a/b/d', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array() ) ) ) ) ), - '5' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 5, 'hidden' => 1, 'has_children' => 0, 'title' => 'Item 5', 'in_active_trail' => 0, 'access' => 1, 'link_path' => 'e', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()), - '6' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 6, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 6', 'in_active_trail' => 0, 'access' => 0, 'link_path' => 'f', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()), - '7' => array('link' => $storage_controller->create(array('menu_name' => 'main-menu', 'mlid' => 7, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 7', 'in_active_trail' => 0, 'access' => 1, 'link_path' => 'g', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()) + '5' => array('link' => $storage->create(array('menu_name' => 'main-menu', 'mlid' => 5, 'hidden' => 1, 'has_children' => 0, 'title' => 'Item 5', 'in_active_trail' => 0, 'access' => 1, 'link_path' => 'e', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()), + '6' => array('link' => $storage->create(array('menu_name' => 'main-menu', 'mlid' => 6, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 6', 'in_active_trail' => 0, 'access' => 0, 'link_path' => 'f', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()), + '7' => array('link' => $storage->create(array('menu_name' => 'main-menu', 'mlid' => 7, 'hidden' => 0, 'has_children' => 0, 'title' => 'Item 7', 'in_active_trail' => 0, 'access' => 1, 'link_path' => 'g', 'localized_options' => array('attributes' => array('title' =>'')))), 'below' => array()) ); $output = menu_tree_output($this->tree_data); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php index 44cccb2..63b96f7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php @@ -126,7 +126,7 @@ protected function getTopLevelMenuLinks() { ->condition('route_name', $routes) ->execute(); - $menu_items = \Drupal::entityManager()->getStorageController('menu_link')->loadMultiple($menu_link_ids); + $menu_items = \Drupal::entityManager()->getStorage('menu_link')->loadMultiple($menu_link_ids); foreach ($menu_items as &$menu_item) { _menu_link_translate($menu_item); } diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 8083f89..8bdfdc2 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -620,7 +620,7 @@ function hook_contextual_links_alter(array &$links, $group, array $route_paramet if ($group == 'menu') { // Dynamically use the menu name for the title of the menu_edit contextual // link. - $menu = \Drupal::entityManager()->getStorageController('menu')->load($route_parameters['menu']); + $menu = \Drupal::entityManager()->getStorage('menu')->load($route_parameters['menu']); $links['menu_edit']['title'] = t('Edit menu: !label', array('!label' => $menu->label())); } } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 2937be2..c06bf06 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1717,15 +1717,15 @@ function system_get_module_admin_tasks($module, $info) { if (\Drupal::moduleHandler()->implementsHook($module, 'permission')) { /** @var \Drupal\Core\Access\AccessManager $access_manager */ $access_manager = \Drupal::service('access_manager'); - /** @var \Drupal\menu_link\MenuLinkStorageControllerInterface $menu_link_storage_controller */ - $menu_link_storage_controller = \Drupal::entityManager() - ->getStorageController('menu_link'); + /** @var \Drupal\menu_link\MenuLinkStorageInterface $menu_link_storage */ + $menu_link_storage = \Drupal::entityManager() + ->getStorage('menu_link'); if ($access_manager->checkNamedRoute('user.admin_permissions', array(), \Drupal::currentUser())) { $path = \Drupal::urlGenerator() ->getPathFromRoute('user.admin_permissions'); $options = array(); $options['fragment'] = 'module-' . $module; - $menu_link = $menu_link_storage_controller->create(array( + $menu_link = $menu_link_storage->create(array( 'route_name' => 'user.admin_permissions', 'link_path' => $path, 'title' => t('Configure @module permissions', array('@module' => $info['name'])), diff --git a/core/modules/system/tests/modules/entity_cache_test_dependency/lib/Drupal/entity_cache_test_dependency/Entity/EntityCacheTest.php b/core/modules/system/tests/modules/entity_cache_test_dependency/lib/Drupal/entity_cache_test_dependency/Entity/EntityCacheTest.php index 8b33daf..ea7d298 100644 --- a/core/modules/system/tests/modules/entity_cache_test_dependency/lib/Drupal/entity_cache_test_dependency/Entity/EntityCacheTest.php +++ b/core/modules/system/tests/modules/entity_cache_test_dependency/lib/Drupal/entity_cache_test_dependency/Entity/EntityCacheTest.php @@ -16,7 +16,7 @@ * id = "entity_cache_test", * label = @Translation("Entity cache test"), * controllers = { - * "storage" = "Drupal\Core\Entity\DatabaseStorageController", + * "storage" = "Drupal\Core\Entity\DatabaseEntityStorage", * } * ) */ diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php index 98ac7cc..a9d114a 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Controller/EntityTestController.php @@ -104,7 +104,7 @@ public function testAdmin() { public function listReferencingEntities($entity_reference_field_name, $referenced_entity_type, $referenced_entity_id) { // Early return if the referenced entity does not exist (or is deleted). $referenced_entity = $this->entityManager() - ->getStorageController($referenced_entity_type) + ->getStorage($referenced_entity_type) ->load($referenced_entity_id); if ($referenced_entity === NULL) { return array(); @@ -114,7 +114,7 @@ public function listReferencingEntities($entity_reference_field_name, $reference ->get('entity_test') ->condition($entity_reference_field_name . '.target_id', $referenced_entity_id); $entities = $this->entityManager() - ->getStorageController('entity_test') + ->getStorage('entity_test') ->loadMultiple($query->execute()); return $this->entityManager() ->getViewBuilder('entity_test') diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php index 357b77e..be3108c 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php @@ -10,7 +10,7 @@ use Drupal\Core\Entity\ContentEntityBase; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Language\Language; use Drupal\user\EntityOwnerInterface; use Drupal\user\UserInterface; @@ -99,10 +99,10 @@ protected function init() { /** * {@inheritdoc} */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { - parent::preCreate($storage_controller, $values); + public static function preCreate(EntityStorageInterface $storage, array &$values) { + parent::preCreate($storage, $values); if (empty($values['type'])) { - $values['type'] = $storage_controller->getEntityTypeId(); + $values['type'] = $storage->getEntityTypeId(); } } diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Controller/FormTestController.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Controller/FormTestController.php index b7ed78c..ad96815 100644 --- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Controller/FormTestController.php +++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Controller/FormTestController.php @@ -28,7 +28,7 @@ public function twoFormInstances() { 'type' => 'page', 'langcode' => Language::LANGCODE_NOT_SPECIFIED, ); - $node1 = $this->entityManager()->getStorageController('node')->create($values); + $node1 = $this->entityManager()->getStorage('node')->create($values); $node2 = clone($node1); $return['node_form_1'] = $this->entityFormBuilder()->getForm($node1); $return['node_form_2'] = $this->entityFormBuilder()->getForm($node2); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php index fb06df8..0312a9d 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php @@ -28,7 +28,7 @@ class TaxonomyController extends ControllerBase { * The taxonomy term add form. */ public function addForm(VocabularyInterface $taxonomy_vocabulary) { - $term = $this->entityManager()->getStorageController('taxonomy_term')->create(array('vid' => $taxonomy_vocabulary->id())); + $term = $this->entityManager()->getStorage('taxonomy_term')->create(array('vid' => $taxonomy_vocabulary->id())); if ($this->moduleHandler()->moduleExists('language')) { $term->langcode = language_get_default_langcode('taxonomy_term', $taxonomy_vocabulary->id()); } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php index dce3472..ab1db7d 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php @@ -13,7 +13,7 @@ use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\Query\QueryInterface; use Drupal\field\FieldInfo; -use Drupal\taxonomy\TermStorageControllerInterface; +use Drupal\taxonomy\TermStorageInterface; use Drupal\taxonomy\VocabularyInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -40,9 +40,9 @@ class TermAutocompleteController implements ContainerInjectionInterface { protected $fieldInfo; /** - * Term storage controller. + * Term storage. * - * @var \Drupal\taxonomy\TermStorageControllerInterface + * @var \Drupal\taxonomy\TermStorageInterface */ protected $termStorage; @@ -53,10 +53,10 @@ class TermAutocompleteController implements ContainerInjectionInterface { * The entity query service. * @param \Drupal\field\FieldInfo $field_info * The field info service. - * @param \Drupal\taxonomy\TermStorageControllerInterface $term_storage - * The term storage controller. + * @param \Drupal\taxonomy\TermStorageInterface $term_storage + * The term storage. */ - public function __construct(QueryInterface $term_entity_query, FieldInfo $field_info, TermStorageControllerInterface $term_storage) { + public function __construct(QueryInterface $term_entity_query, FieldInfo $field_info, TermStorageInterface $term_storage) { $this->termEntityQuery = $term_entity_query; $this->fieldInfo = $field_info; $this->termStorage = $term_storage; @@ -69,7 +69,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('entity.query')->get('taxonomy_term'), $container->get('field.info'), - $container->get('entity.manager')->getStorageController('taxonomy_term') + $container->get('entity.manager')->getStorage('taxonomy_term') ); } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php index 38c84e1..4550acb 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php @@ -8,7 +8,7 @@ namespace Drupal\taxonomy\Entity; use Drupal\Core\Entity\ContentEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; use Drupal\Core\Language\Language; @@ -23,7 +23,7 @@ * label = @Translation("Taxonomy term"), * bundle_label = @Translation("Vocabulary"), * controllers = { - * "storage" = "Drupal\taxonomy\TermStorageController", + * "storage" = "Drupal\taxonomy\TermStorage", * "view_builder" = "Drupal\taxonomy\TermViewBuilder", * "access" = "Drupal\taxonomy\TermAccessController", * "form" = { @@ -64,8 +64,8 @@ public function id() { /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); // See if any of the term's children are about to be become orphans. $orphans = array(); @@ -83,7 +83,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont // Delete term hierarchy information after looking up orphans but before // deleting them so that their children/parent information is consistent. - $storage_controller->deleteTermHierarchy(array_keys($entities)); + $storage->deleteTermHierarchy(array_keys($entities)); if (!empty($orphans)) { entity_delete_multiple('taxonomy_term', $orphans); @@ -93,14 +93,14 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); // Only change the parents if a value is set, keep the existing values if // not. if (isset($this->parent->value)) { - $storage_controller->deleteTermHierarchy(array($this->id())); - $storage_controller->updateTermHierarchy($this); + $storage->deleteTermHierarchy(array($this->id())); + $storage->updateTermHierarchy($this); } } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php index f7e3f91..f5a7ba7 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php @@ -8,7 +8,7 @@ namespace Drupal\taxonomy\Entity; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\field\Field; use Drupal\taxonomy\VocabularyInterface; @@ -19,7 +19,7 @@ * id = "taxonomy_vocabulary", * label = @Translation("Taxonomy vocabulary"), * controllers = { - * "storage" = "Drupal\taxonomy\VocabularyStorageController", + * "storage" = "Drupal\taxonomy\VocabularyStorage", * "list_builder" = "Drupal\taxonomy\VocabularyListBuilder", * "form" = { * "default" = "Drupal\taxonomy\VocabularyFormController", @@ -96,8 +96,8 @@ public function id() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); if (!$update) { entity_invoke_bundle_hook('create', 'taxonomy_term', $this->id()); @@ -115,7 +115,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ } } - $fields = \Drupal::entityManager()->getStorageController('field_config')->loadMultiple($field_ids); + $fields = \Drupal::entityManager()->getStorage('field_config')->loadMultiple($field_ids); foreach ($fields as $field) { $update_field = FALSE; @@ -134,24 +134,24 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ // Update bundles. entity_invoke_bundle_hook('rename', 'taxonomy_term', $this->getOriginalId(), $this->id()); } - $storage_controller->resetCache($update ? array($this->getOriginalId()) : array()); + $storage->resetCache($update ? array($this->getOriginalId()) : array()); } /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::preDelete($storage_controller, $entities); + public static function preDelete(EntityStorageInterface $storage, array $entities) { + parent::preDelete($storage, $entities); // Only load terms without a parent, child terms will get deleted too. - entity_delete_multiple('taxonomy_term', $storage_controller->getToplevelTids(array_keys($entities))); + entity_delete_multiple('taxonomy_term', $storage->getToplevelTids(array_keys($entities))); } /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); $vocabularies = array(); foreach ($entities as $vocabulary) { @@ -181,7 +181,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont } } // Reset caches. - $storage_controller->resetCache(array_keys($vocabularies)); + $storage->resetCache(array_keys($vocabularies)); } } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/TermDeleteForm.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/TermDeleteForm.php index 07b6af1..58fbb12 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/TermDeleteForm.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/TermDeleteForm.php @@ -59,10 +59,10 @@ public function getConfirmText() { */ public function submit(array $form, array &$form_state) { $this->entity->delete(); - $storage_controller = $this->entityManager->getStorageController('taxonomy_vocabulary'); - $vocabulary = $storage_controller->load($this->entity->bundle()); + $storage = $this->entityManager->getStorage('taxonomy_vocabulary'); + $vocabulary = $storage->load($this->entity->bundle()); - // @todo Move to storage controller http://drupal.org/node/1988712 + // @todo Move to storage http://drupal.org/node/1988712 taxonomy_check_vocabulary_hierarchy($vocabulary, array('tid' => $this->entity->id())); drupal_set_message($this->t('Deleted term %name.', array('%name' => $this->entity->getName()))); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php index e18adaa..bae776c 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php @@ -8,7 +8,7 @@ namespace Drupal\taxonomy\Form; use Drupal\Core\Entity\EntityConfirmFormBase; -use Drupal\taxonomy\TermStorageControllerInterface; +use Drupal\taxonomy\TermStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -19,17 +19,17 @@ class VocabularyResetForm extends EntityConfirmFormBase { /** * The term storage. * - * @var \Drupal\taxonomy\TermStorageControllerInterface + * @var \Drupal\taxonomy\TermStorageInterface */ protected $termStorage; /** * Constructs a new VocabularyResetForm object. * - * @param \Drupal\taxonomy\TermStorageControllerInterface $term_storage + * @param \Drupal\taxonomy\TermStorageInterface $term_storage * The term storage. */ - public function __construct(TermStorageControllerInterface $term_storage) { + public function __construct(TermStorageInterface $term_storage) { $this->termStorage = $term_storage; } @@ -38,7 +38,7 @@ public function __construct(TermStorageControllerInterface $term_storage) { */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('taxonomy_term') + $container->get('entity.manager')->getStorage('taxonomy_term') ); } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Field/FieldType/TaxonomyTermReferenceFieldItemList.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Field/FieldType/TaxonomyTermReferenceFieldItemList.php index e5cb463..2965d5d 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Field/FieldType/TaxonomyTermReferenceFieldItemList.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Field/FieldType/TaxonomyTermReferenceFieldItemList.php @@ -31,7 +31,7 @@ protected function getDefaultValue() { ->condition('uuid', $uuids, 'IN') ->execute(); $entities = \Drupal::entityManager() - ->getStorageController('taxonomy_term') + ->getStorage('taxonomy_term') ->loadMultiple($entity_ids); foreach ($entities as $id => $entity) { @@ -66,7 +66,7 @@ public function defaultValuesFormSubmit(array $element, array &$form, array &$fo $ids[] = $properties['target_id']; } $entities = \Drupal::entityManager() - ->getStorageController('taxonomy_term') + ->getStorage('taxonomy_term') ->loadMultiple($ids); foreach ($default_value as $delta => $properties) { diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Validation/Constraint/TermParentConstraintValidator.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Validation/Constraint/TermParentConstraintValidator.php index 53d2411..4532190 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Validation/Constraint/TermParentConstraintValidator.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Validation/Constraint/TermParentConstraintValidator.php @@ -23,7 +23,7 @@ public function validate($field_item, Constraint $constraint) { $parent_term_id = $field_item->value; // If a non-0 parent term id is specified, ensure it corresponds to a real // term in the same vocabulary. - if ($parent_term_id && !\Drupal::entityManager()->getStorageController('taxonomy_term')->loadByProperties(array('tid' => $parent_term_id, 'vid' => $field_item->getEntity()->vid->value))) { + if ($parent_term_id && !\Drupal::entityManager()->getStorage('taxonomy_term')->loadByProperties(array('tid' => $parent_term_id, 'vid' => $field_item->getEntity()->vid->value))) { $this->context->addViolation($constraint->message, array('%id' => $parent_term_id)); } } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument_validator/TermName.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument_validator/TermName.php index bbddc4b..d6d270a 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument_validator/TermName.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument_validator/TermName.php @@ -24,11 +24,11 @@ class TermName extends Entity { /** - * The taxonomy term storage controller. + * The taxonomy term storage. * - * @var \Drupal\taxonomy\TermStorageControllerInterface + * @var \Drupal\taxonomy\TermStorageInterface */ - protected $termStorageController; + protected $termStorage; /** * {@inheritdoc} @@ -37,7 +37,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_manager); // Not handling exploding term names. $this->multipleCapable = FALSE; - $this->termStorageController = $entity_manager->getStorageController('taxonomy_term'); + $this->termStorage = $entity_manager->getStorage('taxonomy_term'); } /** @@ -70,7 +70,7 @@ public function validateArgument($argument) { if ($this->options['transform']) { $argument = str_replace('-', ' ', $argument); } - $terms = $this->termStorageController->loadByProperties(array('name' => $argument)); + $terms = $this->termStorage->loadByProperties(array('name' => $argument)); if (!$terms) { // Returned empty array no terms with the name. diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index f06c479..5806386 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -54,7 +54,7 @@ public static function create(ContainerInterface $container) { */ public function form(array $form, array &$form_state) { $term = $this->entity; - $vocab_storage = $this->entityManager->getStorageController('taxonomy_vocabulary'); + $vocab_storage = $this->entityManager->getStorage('taxonomy_vocabulary'); $vocabulary = $vocab_storage->load($term->bundle()); $parent = array_keys(taxonomy_term_load_parents($term->id())); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorage.php similarity index 89% rename from core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageController.php rename to core/modules/taxonomy/lib/Drupal/taxonomy/TermStorage.php index 75eb28c..6c774d9 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorage.php @@ -2,22 +2,22 @@ /** * @file - * Definition of Drupal\taxonomy\TermStorageController. + * Definition of Drupal\taxonomy\TermStorage. */ namespace Drupal\taxonomy; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\Query\QueryInterface; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; /** * Defines a Controller class for taxonomy terms. */ -class TermStorageController extends FieldableDatabaseStorageController implements TermStorageControllerInterface { +class TermStorage extends FieldableDatabaseEntityStorage implements TermStorageInterface { /** - * Overrides Drupal\Core\Entity\DatabaseStorageController::create(). + * Overrides Drupal\Core\Entity\DatabaseEntityStorage::create(). * * @param array $values * An array of values to set, keyed by property name. A value for the @@ -33,7 +33,7 @@ public function create(array $values = array()) { } /** - * Overrides Drupal\Core\Entity\DatabaseStorageController::buildPropertyQuery(). + * Overrides Drupal\Core\Entity\DatabaseEntityStorage::buildPropertyQuery(). */ protected function buildPropertyQuery(QueryInterface $entity_query, array $values) { if (isset($values['name'])) { @@ -44,7 +44,7 @@ protected function buildPropertyQuery(QueryInterface $entity_query, array $value } /** - * Overrides Drupal\Core\Entity\DatabaseStorageController::resetCache(). + * Overrides Drupal\Core\Entity\DatabaseEntityStorage::resetCache(). */ public function resetCache(array $ids = NULL) { drupal_static_reset('taxonomy_term_count_nodes'); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageControllerInterface.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageInterface.php similarity index 90% rename from core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageControllerInterface.php rename to core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageInterface.php index 8002b22..634ff3d 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageControllerInterface.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageInterface.php @@ -2,18 +2,18 @@ /** * @file - * Contains \Drupal\taxonomy\TermStorageControllerInterface. + * Contains \Drupal\taxonomy\TermStorageInterface. */ namespace Drupal\taxonomy; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines a common interface for taxonomy term entity controller classes. */ -interface TermStorageControllerInterface extends EntityStorageControllerInterface { +interface TermStorageInterface extends EntityStorageInterface { /** * Removed reference to terms from term_hierarchy. diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermValidationTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermValidationTest.php index 009d871..737f662 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermValidationTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermValidationTest.php @@ -41,11 +41,11 @@ public function setUp() { * Tests the term validation constraints. */ public function testValidation() { - $this->entityManager->getStorageController('taxonomy_vocabulary')->create(array( + $this->entityManager->getStorage('taxonomy_vocabulary')->create(array( 'vid' => 'tags', 'name' => 'Tags', ))->save(); - $term = $this->entityManager->getStorageController('taxonomy_term')->create(array( + $term = $this->entityManager->getStorage('taxonomy_term')->create(array( 'name' => 'test', 'vid' => 'tags', )); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php index ec22ffd..f015a2d 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php @@ -96,7 +96,7 @@ function testTaxonomyAdminChangingWeights() { $this->drupalPostForm('admin/structure/taxonomy', $edit, t('Save')); // Load the vocabularies from the database. - $this->container->get('entity.manager')->getStorageController('taxonomy_vocabulary')->resetCache(); + $this->container->get('entity.manager')->getStorage('taxonomy_vocabulary')->resetCache(); $new_vocabularies = entity_load_multiple('taxonomy_vocabulary'); // Check that the weights are saved in the database correctly. @@ -135,7 +135,7 @@ function testTaxonomyAdminDeletingVocabulary() { $this->assertText(t('Created new vocabulary'), 'New vocabulary was created.'); // Check the created vocabulary. - $this->container->get('entity.manager')->getStorageController('taxonomy_vocabulary')->resetCache(); + $this->container->get('entity.manager')->getStorage('taxonomy_vocabulary')->resetCache(); $vocabulary = entity_load('taxonomy_vocabulary', $vid); $this->assertTrue($vocabulary, 'Vocabulary found.'); @@ -148,7 +148,7 @@ function testTaxonomyAdminDeletingVocabulary() { // Confirm deletion. $this->drupalPostForm(NULL, NULL, t('Delete')); $this->assertRaw(t('Deleted vocabulary %name.', array('%name' => $vocabulary->name)), 'Vocabulary deleted.'); - $this->container->get('entity.manager')->getStorageController('taxonomy_vocabulary')->resetCache(); + $this->container->get('entity.manager')->getStorage('taxonomy_vocabulary')->resetCache(); $this->assertFalse(entity_load('taxonomy_vocabulary', $vid), 'Vocabulary not found.'); } } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php index a03d17f..ae757f3 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php @@ -127,7 +127,7 @@ function testTaxonomyVocabularyLoadMultiple() { $this->assertIdentical($loaded_order, $expected_order); // Test loading vocabularies by their properties. - $controller = $this->container->get('entity.manager')->getStorageController('taxonomy_vocabulary'); + $controller = $this->container->get('entity.manager')->getStorage('taxonomy_vocabulary'); // Fetch vocabulary 1 by name. $vocabulary = current($controller->loadByProperties(array('name' => $vocabulary1->name))); $this->assertEqual($vocabulary->id(), $vocabulary1->id(), 'Vocabulary loaded successfully by name.'); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorage.php similarity index 73% rename from core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageController.php rename to core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorage.php index 249b0b8..f14b951 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorage.php @@ -2,18 +2,18 @@ /** * @file - * Definition of Drupal\taxonomy\VocabularyStorageController. + * Definition of Drupal\taxonomy\VocabularyStorage. */ namespace Drupal\taxonomy; use Drupal\Core\Cache\Cache; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; /** * Defines a controller class for taxonomy vocabularies. */ -class VocabularyStorageController extends ConfigStorageController implements VocabularyStorageControllerInterface { +class VocabularyStorage extends ConfigEntityStorage implements VocabularyStorageInterface { /** * {@inheritdoc} diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageControllerInterface.php b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageInterface.php similarity index 62% rename from core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageControllerInterface.php rename to core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageInterface.php index 3b9a925..c4e1aec 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageControllerInterface.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageInterface.php @@ -2,17 +2,17 @@ /** * @file - * Contains \Drupal\taxonomy\VocabularyStorageControllerInterface. + * Contains \Drupal\taxonomy\VocabularyStorageInterface. */ namespace Drupal\taxonomy; -use Drupal\Core\Config\Entity\ConfigStorageControllerInterface; +use Drupal\Core\Config\Entity\ConfigEntityStorageInterface; /** * Defines a common interface for taxonomy vocabulary entity controller classes. */ -interface VocabularyStorageControllerInterface extends ConfigStorageControllerInterface { +interface VocabularyStorageInterface extends ConfigEntityStorageInterface { /** * Gets top-level term IDs of vocabularies. diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 62952af..37ee006 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -6,7 +6,7 @@ */ use Drupal\Component\Utility\Tags; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\Core\Entity\EntityInterface; use Drupal\file\FileInterface; use Drupal\node\Entity\Node; @@ -399,7 +399,7 @@ function taxonomy_term_is_page(Term $term) { * Clear all static cache variables for terms. */ function taxonomy_terms_static_reset() { - \Drupal::entityManager()->getStorageController('taxonomy_term')->resetCache(); + \Drupal::entityManager()->getStorage('taxonomy_term')->resetCache(); } /** @@ -409,7 +409,7 @@ function taxonomy_terms_static_reset() { * An array of ids to reset in entity controller cache. */ function taxonomy_vocabulary_static_reset(array $ids = NULL) { - \Drupal::entityManager()->getStorageController('taxonomy_vocabulary')->resetCache($ids); + \Drupal::entityManager()->getStorage('taxonomy_vocabulary')->resetCache($ids); } /** @@ -447,7 +447,7 @@ function taxonomy_term_load_parents($tid) { $parents = &drupal_static(__FUNCTION__, array()); if ($tid && !isset($parents[$tid])) { - $tids = \Drupal::entityManager()->getStorageController('taxonomy_term')->loadParents($tid); + $tids = \Drupal::entityManager()->getStorage('taxonomy_term')->loadParents($tid); $parents[$tid] = entity_load_multiple('taxonomy_term', $tids); } @@ -495,7 +495,7 @@ function taxonomy_term_load_children($tid, $vid = NULL) { $children = &drupal_static(__FUNCTION__, array()); if ($tid && !isset($children[$tid])) { - $tids = \Drupal::entityManager()->getStorageController('taxonomy_term')->loadChildren($tid); + $tids = \Drupal::entityManager()->getStorage('taxonomy_term')->loadChildren($tid); $children[$tid] = entity_load_multiple('taxonomy_term', $tids); } @@ -536,7 +536,7 @@ function taxonomy_get_tree($vid, $parent = 0, $max_depth = NULL, $load_entities $parents[$vid] = array(); $terms[$vid] = array(); - $result = \Drupal::entityManager()->getStorageController('taxonomy_term')->loadTree($vid); + $result = \Drupal::entityManager()->getStorage('taxonomy_term')->loadTree($vid); foreach ($result as $term) { $children[$vid][$term->parent][] = $term->tid; @@ -824,7 +824,7 @@ function taxonomy_node_insert(EntityInterface $node) { function taxonomy_build_node_index($node) { // We maintain a denormalized table of term/node relationships, containing // only data for current, published nodes. - if (!\Drupal::config('taxonomy.settings')->get('maintain_index_table') || !(\Drupal::entityManager()->getStorageController('node') instanceof FieldableDatabaseStorageController)) { + if (!\Drupal::config('taxonomy.settings')->get('maintain_index_table') || !(\Drupal::entityManager()->getStorage('node') instanceof FieldableDatabaseEntityStorage)) { return; } diff --git a/core/modules/taxonomy/taxonomy.tokens.inc b/core/modules/taxonomy/taxonomy.tokens.inc index f89f0a6..ce331da 100644 --- a/core/modules/taxonomy/taxonomy.tokens.inc +++ b/core/modules/taxonomy/taxonomy.tokens.inc @@ -176,7 +176,7 @@ function taxonomy_tokens($type, $tokens, array $data = array(), array $options = break; case 'node-count': - $replacements[$original] = \Drupal::entityManager()->getStorageController('taxonomy_term')->nodeCount($vocabulary->id()); + $replacements[$original] = \Drupal::entityManager()->getStorage('taxonomy_term')->nodeCount($vocabulary->id()); break; } } diff --git a/core/modules/taxonomy/taxonomy.views.inc b/core/modules/taxonomy/taxonomy.views.inc index e2eb59f..4d3fead 100644 --- a/core/modules/taxonomy/taxonomy.views.inc +++ b/core/modules/taxonomy/taxonomy.views.inc @@ -5,7 +5,7 @@ * Provide views data for taxonomy.module. */ -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\field\FieldConfigInterface; /** @@ -448,7 +448,7 @@ function taxonomy_field_views_data_views_data_alter(array &$data, FieldConfigInt 'id' => 'entity_reverse', 'field_name' => $field_name, 'entity_type' => $entity_type_id, - 'field table' => FieldableDatabaseStorageController::_fieldTableName($field), + 'field table' => FieldableDatabaseEntityStorage::_fieldTableName($field), 'field field' => $field_name . '_target_id', 'base' => $entity_type->getBaseTable(), 'base field' => $entity_type->getKey('id'), diff --git a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php index e1efa12..aecf257 100644 --- a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php +++ b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php @@ -251,7 +251,7 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) { $this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated'); // Display the entity. - $this->container->get('entity.manager')->getStorageController('entity_test')->resetCache(array($id)); + $this->container->get('entity.manager')->getStorage('entity_test')->resetCache(array($id)); $entity = entity_load('entity_test', $id); $display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), 'full'); $content = $display->build($entity); diff --git a/core/modules/tour/lib/Drupal/tour/Entity/Tour.php b/core/modules/tour/lib/Drupal/tour/Entity/Tour.php index 3a473d7..1361942 100644 --- a/core/modules/tour/lib/Drupal/tour/Entity/Tour.php +++ b/core/modules/tour/lib/Drupal/tour/Entity/Tour.php @@ -8,7 +8,7 @@ namespace Drupal\tour\Entity; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\tour\TipsBag; use Drupal\tour\TourInterface; diff --git a/core/modules/user/lib/Drupal/user/Entity/Role.php b/core/modules/user/lib/Drupal/user/Entity/Role.php index 0ce5186..81a0ee6 100644 --- a/core/modules/user/lib/Drupal/user/Entity/Role.php +++ b/core/modules/user/lib/Drupal/user/Entity/Role.php @@ -9,7 +9,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\user\RoleInterface; /** @@ -19,7 +19,7 @@ * id = "user_role", * label = @Translation("Role"), * controllers = { - * "storage" = "Drupal\user\RoleStorageController", + * "storage" = "Drupal\user\RoleStorage", * "access" = "Drupal\user\RoleAccessController", * "list_builder" = "Drupal\user\RoleListBuilder", * "form" = { @@ -106,8 +106,8 @@ public function revokePermission($permission) { /** * {@inheritdoc} */ - public static function postLoad(EntityStorageControllerInterface $storage_controller, array &$entities) { - parent::postLoad($storage_controller, $entities); + public static function postLoad(EntityStorageInterface $storage, array &$entities) { + parent::postLoad($storage, $entities); // Sort the queried roles by their weight. // See \Drupal\Core\Config\Entity\ConfigEntityBase::sort(). uasort($entities, 'static::sort'); @@ -116,10 +116,10 @@ public static function postLoad(EntityStorageControllerInterface $storage_contro /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { - parent::preSave($storage_controller); + public function preSave(EntityStorageInterface $storage) { + parent::preSave($storage); - if (!isset($this->weight) && ($roles = $storage_controller->loadMultiple())) { + if (!isset($this->weight) && ($roles = $storage->loadMultiple())) { // Set a role weight to make this new role last. $max = array_reduce($roles, function($max, $role) { return $max > $role->weight ? $max : $role->weight; @@ -131,8 +131,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); Cache::invalidateTags(array('role' => $this->id())); // Clear render cache. @@ -142,11 +142,11 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); $ids = array_keys($entities); - $storage_controller->deleteRoleReferences($ids); + $storage->deleteRoleReferences($ids); Cache::invalidateTags(array('role' => $ids)); } diff --git a/core/modules/user/lib/Drupal/user/Entity/User.php b/core/modules/user/lib/Drupal/user/Entity/User.php index 8cac65c..6216bc5 100644 --- a/core/modules/user/lib/Drupal/user/Entity/User.php +++ b/core/modules/user/lib/Drupal/user/Entity/User.php @@ -8,7 +8,7 @@ namespace Drupal\user\Entity; use Drupal\Core\Entity\ContentEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityMalformedException; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\FieldDefinition; @@ -22,7 +22,7 @@ * id = "user", * label = @Translation("User"), * controllers = { - * "storage" = "Drupal\user\UserStorageController", + * "storage" = "Drupal\user\UserStorage", * "access" = "Drupal\user\UserAccessController", * "list_builder" = "Drupal\user\UserListBuilder", * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder", @@ -70,8 +70,8 @@ public function isNew() { /** * {@inheritdoc} */ - static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { - parent::preCreate($storage_controller, $values); + static function preCreate(EntityStorageInterface $storage, array &$values) { + parent::preCreate($storage, $values); // Users always have the authenticated user role. $values['roles'][] = DRUPAL_AUTHENTICATED_RID; @@ -80,8 +80,8 @@ static function preCreate(EntityStorageControllerInterface $storage_controller, /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { - parent::preSave($storage_controller); + public function preSave(EntityStorageInterface $storage) { + parent::preSave($storage); // Update the user password if it has changed. if ($this->isNew() || ($this->pass->value && $this->pass->value != $this->original->pass->value)) { @@ -112,8 +112,8 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); if ($update) { // If the password has been changed, delete all open sessions for the @@ -127,8 +127,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ // Update user roles if changed. if ($this->getRoles() != $this->original->getRoles()) { - $storage_controller->deleteUserRoles(array($this->id())); - $storage_controller->saveRoles($this); + $storage->deleteUserRoles(array($this->id())); + $storage->saveRoles($this); } // If the user was blocked, delete the user's sessions to force a logout. @@ -146,7 +146,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ else { // Save user roles. if (count($this->getRoles()) > 1) { - $storage_controller->saveRoles($this); + $storage->saveRoles($this); } } } @@ -154,12 +154,12 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); $uids = array_keys($entities); \Drupal::service('user.data')->delete(NULL, $uids); - $storage_controller->deleteUserRoles($uids); + $storage->deleteUserRoles($uids); } /** @@ -225,7 +225,7 @@ public function hasPermission($permission) { return TRUE; } - $roles = \Drupal::entityManager()->getStorageController('user_role')->loadMultiple($this->getRoles()); + $roles = \Drupal::entityManager()->getStorage('user_role')->loadMultiple($this->getRoles()); foreach ($roles as $role) { if ($role->hasPermission($permission)) { diff --git a/core/modules/user/lib/Drupal/user/Form/UserLoginForm.php b/core/modules/user/lib/Drupal/user/Form/UserLoginForm.php index dcc6845..4dd180f 100644 --- a/core/modules/user/lib/Drupal/user/Form/UserLoginForm.php +++ b/core/modules/user/lib/Drupal/user/Form/UserLoginForm.php @@ -10,7 +10,7 @@ use Drupal\Core\Flood\FloodInterface; use Drupal\Core\Form\FormBase; use Drupal\user\UserAuthInterface; -use Drupal\user\UserStorageControllerInterface; +use Drupal\user\UserStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -26,9 +26,9 @@ class UserLoginForm extends FormBase { protected $flood; /** - * The user storage controller. + * The user storage. * - * @var \Drupal\user\UserStorageControllerInterface + * @var \Drupal\user\UserStorageInterface */ protected $userStorage; @@ -44,12 +44,12 @@ class UserLoginForm extends FormBase { * * @param \Drupal\Core\Flood\FloodInterface $flood * The flood service. - * @param \Drupal\user\UserStorageControllerInterface $user_storage - * The user storage controller. + * @param \Drupal\user\UserStorageInterface $user_storage + * The user storage. * @param \Drupal\user\UserAuthInterface $user_auth * The user authentication object. */ - public function __construct(FloodInterface $flood, UserStorageControllerInterface $user_storage, UserAuthInterface $user_auth) { + public function __construct(FloodInterface $flood, UserStorageInterface $user_storage, UserAuthInterface $user_auth) { $this->flood = $flood; $this->userStorage = $user_storage; $this->userAuth = $user_auth; @@ -61,7 +61,7 @@ public function __construct(FloodInterface $flood, UserStorageControllerInterfac public static function create(ContainerInterface $container) { return new static( $container->get('flood'), - $container->get('entity.manager')->getStorageController('user'), + $container->get('entity.manager')->getStorage('user'), $container->get('user.auth') ); } diff --git a/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.php b/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.php index 07295c5..18d69d9 100644 --- a/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.php +++ b/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.php @@ -13,7 +13,7 @@ use Drupal\Core\Form\ConfirmFormBase; use Drupal\Core\Routing\UrlGeneratorInterface; use Drupal\user\TempStoreFactory; -use Drupal\user\UserStorageControllerInterface; +use Drupal\user\UserStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -37,9 +37,9 @@ class UserMultipleCancelConfirm extends ConfirmFormBase { protected $configFactory; /** - * The user storage controller. + * The user storage. * - * @var \Drupal\user\UserStorageControllerInterface + * @var \Drupal\user\UserStorageInterface */ protected $userStorage; @@ -57,12 +57,12 @@ class UserMultipleCancelConfirm extends ConfirmFormBase { * The temp store factory. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The config factory. - * @param \Drupal\user\UserStorageControllerInterface $user_storage - * The user storage controller. + * @param \Drupal\user\UserStorageInterface $user_storage + * The user storage. * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager. */ - public function __construct(TempStoreFactory $temp_store_factory, ConfigFactoryInterface $config_factory, UserStorageControllerInterface $user_storage, EntityManagerInterface $entity_manager) { + public function __construct(TempStoreFactory $temp_store_factory, ConfigFactoryInterface $config_factory, UserStorageInterface $user_storage, EntityManagerInterface $entity_manager) { $this->tempStoreFactory = $temp_store_factory; $this->configFactory = $config_factory; $this->userStorage = $user_storage; @@ -76,7 +76,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('user.tempstore'), $container->get('config.factory'), - $container->get('entity.manager')->getStorageController('user'), + $container->get('entity.manager')->getStorage('user'), $container->get('entity.manager') ); } diff --git a/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php b/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php index f7f7cfe..15d48c8 100644 --- a/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php +++ b/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php @@ -11,7 +11,7 @@ use Drupal\Core\Form\FormBase; use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageManager; -use Drupal\user\UserStorageControllerInterface; +use Drupal\user\UserStorageInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,11 +21,11 @@ class UserPasswordForm extends FormBase { /** - * The user storage controller. + * The user storage. * - * @var \Drupal\user\UserStorageControllerInterface + * @var \Drupal\user\UserStorageInterface */ - protected $userStorageController; + protected $userStorage; /** * The language manager. @@ -37,13 +37,13 @@ class UserPasswordForm extends FormBase { /** * Constructs a UserPasswordForm object. * - * @param \Drupal\user\UserStorageControllerInterface $user_storage_controller - * The user storage controller. + * @param \Drupal\user\UserStorageInterface $user_storage + * The user storage. * @param \Drupal\Core\Language\LanguageManager $language_manager * The language manager. */ - public function __construct(UserStorageControllerInterface $user_storage_controller, LanguageManager $language_manager) { - $this->userStorageController = $user_storage_controller; + public function __construct(UserStorageInterface $user_storage, LanguageManager $language_manager) { + $this->userStorage = $user_storage; $this->languageManager = $language_manager; } @@ -52,7 +52,7 @@ public function __construct(UserStorageControllerInterface $user_storage_control */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('user'), + $container->get('entity.manager')->getStorage('user'), $container->get('language_manager') ); } @@ -110,10 +110,10 @@ public function buildForm(array $form, array &$form_state) { public function validateForm(array &$form, array &$form_state) { $name = trim($form_state['values']['name']); // Try to load by email. - $users = $this->userStorageController->loadByProperties(array('mail' => $name, 'status' => '1')); + $users = $this->userStorage->loadByProperties(array('mail' => $name, 'status' => '1')); if (empty($users)) { // No success, try to load by name. - $users = $this->userStorageController->loadByProperties(array('name' => $name, 'status' => '1')); + $users = $this->userStorage->loadByProperties(array('name' => $name, 'status' => '1')); } $account = reset($users); if ($account && $account->id()) { diff --git a/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php b/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php index a1586a6..7eee62d 100644 --- a/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php +++ b/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php @@ -11,7 +11,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormBase; -use Drupal\user\RoleStorageControllerInterface; +use Drupal\user\RoleStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -29,7 +29,7 @@ class UserPermissionsForm extends FormBase { /** * The role storage. * - * @var \Drupal\user\RoleStorageControllerInterface + * @var \Drupal\user\RoleStorageInterface */ protected $roleStorage; @@ -38,10 +38,10 @@ class UserPermissionsForm extends FormBase { * * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. - * @param \Drupal\user\RoleStorageControllerInterface $role_storage + * @param \Drupal\user\RoleStorageInterface $role_storage * The role storage. */ - public function __construct(ModuleHandlerInterface $module_handler, RoleStorageControllerInterface $role_storage) { + public function __construct(ModuleHandlerInterface $module_handler, RoleStorageInterface $role_storage) { $this->moduleHandler = $module_handler; $this->roleStorage = $role_storage; } @@ -52,7 +52,7 @@ public function __construct(ModuleHandlerInterface $module_handler, RoleStorageC public static function create(ContainerInterface $container) { return new static( $container->get('module_handler'), - $container->get('entity.manager')->getStorageController('user_role') + $container->get('entity.manager')->getStorage('user_role') ); } diff --git a/core/modules/user/lib/Drupal/user/Plugin/Search/UserSearch.php b/core/modules/user/lib/Drupal/user/Plugin/Search/UserSearch.php index 518d9c0..e9697ed 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/Search/UserSearch.php +++ b/core/modules/user/lib/Drupal/user/Plugin/Search/UserSearch.php @@ -135,7 +135,7 @@ public function execute() { ->limit(15) ->execute() ->fetchCol(); - $accounts = $this->entityManager->getStorageController('user')->loadMultiple($uids); + $accounts = $this->entityManager->getStorage('user')->loadMultiple($uids); foreach ($accounts as $account) { $result = array( diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/argument/RolesRid.php b/core/modules/user/lib/Drupal/user/Plugin/views/argument/RolesRid.php index 743d6cd..b293675 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/argument/RolesRid.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/argument/RolesRid.php @@ -22,11 +22,11 @@ class RolesRid extends ManyToOne { /** - * The role entity storage controller + * The role entity storage * - * @var \Drupal\user\RoleStorageController + * @var \Drupal\user\RoleStorage */ - protected $roleStorageController; + protected $roleStorage; /** * Constructs a \Drupal\user\Plugin\views\argument\RolesRid object. @@ -43,7 +43,7 @@ class RolesRid extends ManyToOne { public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityManagerInterface $entity_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->roleStorageController = $entity_manager->getStorageController('user_role'); + $this->roleStorage = $entity_manager->getStorage('user_role'); } /** @@ -57,7 +57,7 @@ public static function create(ContainerInterface $container, array $configuratio * {@inheritdoc} */ public function title_query() { - $entities = $this->roleStorageController->loadMultiple($this->value); + $entities = $this->roleStorage->loadMultiple($this->value); $titles = array(); foreach ($entities as $entity) { $titles[] = String::checkPlain($entity->label()); diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php b/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php index 0c299d1..cb5013a 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php @@ -8,7 +8,7 @@ namespace Drupal\user\Plugin\views\argument; use Drupal\Component\Utility\String; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\views\Plugin\views\argument\Numeric; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,11 +22,11 @@ class Uid extends Numeric { /** - * The user storage controller. + * The user storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * Constructs a Drupal\Component\Plugin\PluginBase object. @@ -37,12 +37,12 @@ class Uid extends Numeric { * The plugin_id for the plugin instance. * @param array $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The user storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The user storage. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageControllerInterface $storage_controller) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->storageController = $storage_controller; + $this->storage = $storage; } /** @@ -50,7 +50,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) { return new static($configuration, $plugin_id, $plugin_definition, - $container->get('entity.manager')->getStorageController('user')); + $container->get('entity.manager')->getStorage('user')); } /** @@ -62,7 +62,7 @@ public static function create(ContainerInterface $container, array $configuratio public function titleQuery() { return array_map(function($account) { return String::checkPlain($account->label()); - }, $this->storageController->loadMultiple($this->value)); + }, $this->storage->loadMultiple($this->value)); } } diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php index dc55c92..0e9b4ea 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php @@ -24,11 +24,11 @@ class Permissions extends PrerenderList { /** - * The role storage controller. + * The role storage. * - * @var \Drupal\user\RoleStorageControllerInterface + * @var \Drupal\user\RoleStorageInterface */ - protected $roleStorageController; + protected $roleStorage; /** * The module handler. @@ -54,7 +54,7 @@ class Permissions extends PrerenderList { public function __construct(array $configuration, $plugin_id, array $plugin_definition, ModuleHandlerInterface $module_handler, EntityManagerInterface $entity_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->roleStorageController = $entity_manager->getStorageController('user_role'); + $this->roleStorage = $entity_manager->getStorage('user_role'); $this->moduleHandler = $module_handler; } @@ -96,7 +96,7 @@ public function preRender(&$values) { } if ($rids) { - $roles = $this->roleStorageController->loadMultiple(array_keys($rids)); + $roles = $this->roleStorage->loadMultiple(array_keys($rids)); foreach ($rids as $rid => $role_uids) { foreach ($roles[$rid]->getPermissions() as $permission) { foreach ($role_uids as $uid) { diff --git a/core/modules/user/lib/Drupal/user/RoleStorageController.php b/core/modules/user/lib/Drupal/user/RoleStorage.php similarity index 59% rename from core/modules/user/lib/Drupal/user/RoleStorageController.php rename to core/modules/user/lib/Drupal/user/RoleStorage.php index 0c6fbfe..c875c93 100644 --- a/core/modules/user/lib/Drupal/user/RoleStorageController.php +++ b/core/modules/user/lib/Drupal/user/RoleStorage.php @@ -2,17 +2,17 @@ /** * @file - * Contains \Drupal\user\RoleStorageController. + * Contains \Drupal\user\RoleStorage. */ namespace Drupal\user; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; /** * Controller class for user roles. */ -class RoleStorageController extends ConfigStorageController implements RoleStorageControllerInterface { +class RoleStorage extends ConfigEntityStorage implements RoleStorageInterface { /** * {@inheritdoc} diff --git a/core/modules/user/lib/Drupal/user/RoleStorageControllerInterface.php b/core/modules/user/lib/Drupal/user/RoleStorageInterface.php similarity index 52% rename from core/modules/user/lib/Drupal/user/RoleStorageControllerInterface.php rename to core/modules/user/lib/Drupal/user/RoleStorageInterface.php index 86e68ac..d094d5e 100644 --- a/core/modules/user/lib/Drupal/user/RoleStorageControllerInterface.php +++ b/core/modules/user/lib/Drupal/user/RoleStorageInterface.php @@ -2,23 +2,23 @@ /** * @file - * Contains \Drupal\user\RoleStorageControllerInterface. + * Contains \Drupal\user\RoleStorageInterface. */ namespace Drupal\user; -use Drupal\Core\Config\Entity\ConfigStorageControllerInterface; +use Drupal\Core\Config\Entity\ConfigEntityStorageInterface; /** * Defines a common interface for roel entity controller classes. */ -interface RoleStorageControllerInterface extends ConfigStorageControllerInterface { +interface RoleStorageInterface extends ConfigEntityStorageInterface { /** * Delete role references. * * @param array $rids - * The list of role IDs being deleted. The storage controller should + * The list of role IDs being deleted. The storage should * remove permission and user references to this role. */ public function deleteRoleReferences(array $rids); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEntityTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEntityTest.php index 00fbe34..43bee29 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserEntityTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserEntityTest.php @@ -41,7 +41,7 @@ public static function getInfo() { * @see \Drupal\user\Entity\User::removeRole() */ public function testUserMethods() { - $role_storage = $this->container->get('entity.manager')->getStorageController('user_role'); + $role_storage = $this->container->get('entity.manager')->getStorage('user_role'); $role_storage->create(array('id' => 'test_role_one'))->save(); $role_storage->create(array('id' => 'test_role_two'))->save(); $role_storage->create(array('id' => 'test_role_three'))->save(); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php index 17fadc8..ca3f04a 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php @@ -8,7 +8,7 @@ namespace Drupal\user\Tests; use Drupal\simpletest\WebTestBase; -use Drupal\user\RoleStorageController; +use Drupal\user\RoleStorage; class UserPermissionsTest extends WebTestBase { protected $admin_user; @@ -51,8 +51,8 @@ function testUserPermissionChanges() { $edit[$rid . '[administer users]'] = TRUE; $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions')); $this->assertText(t('The changes have been saved.'), 'Successful save message displayed.'); - $storage_controller = $this->container->get('entity.manager')->getStorageController('user_role'); - $storage_controller->resetCache(); + $storage = $this->container->get('entity.manager')->getStorage('user_role'); + $storage->resetCache(); $this->assertTrue($account->hasPermission('administer users'), 'User now has "administer users" permission.'); $current_permissions_hash = $permissions_hash_generator->generate($account); $this->assertIdentical($current_permissions_hash, $permissions_hash_generator->generate($this->loggedInUser)); @@ -65,7 +65,7 @@ function testUserPermissionChanges() { $edit[$rid . '[access user profiles]'] = FALSE; $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions')); $this->assertText(t('The changes have been saved.'), 'Successful save message displayed.'); - $storage_controller->resetCache(); + $storage->resetCache(); $this->assertFalse($account->hasPermission('access user profiles'), 'User no longer has "access user profiles" permission.'); $current_permissions_hash = $permissions_hash_generator->generate($account); $this->assertIdentical($current_permissions_hash, $permissions_hash_generator->generate($this->loggedInUser)); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php index 7aae5e5..ee84db2 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php @@ -55,7 +55,7 @@ function testRegistrationWithEmailVerification() { $edit['name'] = $name = $this->randomName(); $edit['mail'] = $mail = $edit['name'] . '@example.com'; $this->drupalPostForm('user/register', $edit, t('Create new account')); - $this->container->get('entity.manager')->getStorageController('user')->resetCache(); + $this->container->get('entity.manager')->getStorage('user')->resetCache(); $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail)); $new_user = reset($accounts); $this->assertFalse($new_user->isActive(), 'New account is blocked until approved by an administrator.'); @@ -84,7 +84,7 @@ function testRegistrationWithoutEmailVerification() { $edit['pass[pass1]'] = $new_pass = $this->randomName(); $edit['pass[pass2]'] = $new_pass; $this->drupalPostForm('user/register', $edit, t('Create new account')); - $this->container->get('entity.manager')->getStorageController('user')->resetCache(); + $this->container->get('entity.manager')->getStorage('user')->resetCache(); $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail)); $new_user = reset($accounts); $this->assertNotNull($new_user, 'New account successfully created with matching passwords.'); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSaveTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSaveTest.php index be96d7a..3f9f11d 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserSaveTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserSaveTest.php @@ -10,7 +10,7 @@ use Drupal\simpletest\WebTestBase; /** - * Tests \Drupal\user\UserStorageController::save() behavior. + * Tests \Drupal\user\UserStorage::save() behavior. */ class UserSaveTest extends WebTestBase { diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleTest.php index df4a6a7..53ecc44 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleTest.php @@ -39,7 +39,7 @@ public static function getInfo() { */ function testAccessRole() { /** @var \Drupal\views\ViewStorageInterface $view */ - $view = \Drupal::entityManager()->getStorageController('view')->load('test_access_role'); + $view = \Drupal::entityManager()->getStorage('view')->load('test_access_role'); $display = &$view->getDisplay('default'); $display['display_options']['access']['options']['role'] = array( $this->normalRole => $this->normalRole, diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleUITest.php b/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleUITest.php index 3ae1dc6..017c1a3 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleUITest.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/AccessRoleUITest.php @@ -56,13 +56,13 @@ protected function setUp() { */ public function testAccessRoleUI() { $entity_manager = $this->container->get('entity.manager'); - $entity_manager->getStorageController('user_role')->create(array('id' => 'custom_role', 'label' => 'Custom role'))->save(); + $entity_manager->getStorage('user_role')->create(array('id' => 'custom_role', 'label' => 'Custom role'))->save(); $access_url = "admin/structure/views/nojs/display/test_access_role/default/access_options"; $this->drupalPostForm($access_url, array('access_options[role][custom_role]' => 1), t('Apply')); $this->assertResponse(200); $this->drupalPostForm(NULL, array(), t('Save')); - $view = $entity_manager->getStorageController('view')->load('test_access_role'); + $view = $entity_manager->getStorage('view')->load('test_access_role'); $display = $view->getDisplay('default'); $this->assertEqual($display['display_options']['access']['options']['role'], array('custom_role' => 'custom_role')); diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php b/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php index bec7c5a..eafc620 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php @@ -30,18 +30,18 @@ protected $users = array(); /** - * The entity storage controller for roles. + * The entity storage for roles. * - * @var \Drupal\user\RoleStorageController + * @var \Drupal\user\RoleStorage */ - protected $roleStorageController; + protected $roleStorage; /** - * The entity storage controller for users. + * The entity storage for users. * - * @var \Drupal\user\UserStorageController + * @var \Drupal\user\UserStorage */ - protected $userStorageController; + protected $userStorage; protected function setUp() { parent::setUp(); @@ -52,8 +52,8 @@ protected function setUp() { $this->installSchema('system', 'sequences'); $entity_manager = $this->container->get('entity.manager'); - $this->roleStorageController = $entity_manager->getStorageController('user_role'); - $this->userStorageController = $entity_manager->getStorageController('user'); + $this->roleStorage = $entity_manager->getStorage('user_role'); + $this->userStorage = $entity_manager->getStorage('user'); } /** @@ -61,33 +61,33 @@ protected function setUp() { */ protected function setupPermissionTestData() { // Setup a role without any permission. - $this->roleStorageController->create(array('id' => 'authenticated')) + $this->roleStorage->create(array('id' => 'authenticated')) ->save(); - $this->roleStorageController->create(array('id' => 'no_permission')) + $this->roleStorage->create(array('id' => 'no_permission')) ->save(); // Setup a role with just one permission. - $this->roleStorageController->create(array('id' => 'one_permission')) + $this->roleStorage->create(array('id' => 'one_permission')) ->save(); user_role_grant_permissions('one_permission', array('administer permissions')); // Setup a role with multiple permissions. - $this->roleStorageController->create(array('id' => 'multiple_permissions')) + $this->roleStorage->create(array('id' => 'multiple_permissions')) ->save(); user_role_grant_permissions('multiple_permissions', array('administer permissions', 'administer users', 'access user profiles')); // Setup a user without an extra role. - $this->users[] = $account = $this->userStorageController->create(array()); + $this->users[] = $account = $this->userStorage->create(array()); $account->save(); // Setup a user with just the first role (so no permission beside the // ones from the authenticated role). - $this->users[] = $account = $this->userStorageController->create(array('name' => 'first_role')); + $this->users[] = $account = $this->userStorage->create(array('name' => 'first_role')); $account->addRole('no_permission'); $account->save(); // Setup a user with just the second role (so one additional permission). - $this->users[] = $account = $this->userStorageController->create(array('name' => 'second_role')); + $this->users[] = $account = $this->userStorage->create(array('name' => 'second_role')); $account->addRole('one_permission'); $account->save(); // Setup a user with both the second and the third role. - $this->users[] = $account = $this->userStorageController->create(array('name' => 'second_third_role')); + $this->users[] = $account = $this->userStorage->create(array('name' => 'second_third_role')); $account->addRole('one_permission'); $account->addRole('multiple_permissions'); $account->save(); diff --git a/core/modules/user/lib/Drupal/user/UserAuth.php b/core/modules/user/lib/Drupal/user/UserAuth.php index 3ce2683..537c548 100644 --- a/core/modules/user/lib/Drupal/user/UserAuth.php +++ b/core/modules/user/lib/Drupal/user/UserAuth.php @@ -8,7 +8,7 @@ namespace Drupal\user; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Password\PasswordInterface; /** @@ -19,7 +19,7 @@ class UserAuth implements UserAuthInterface { /** * The user storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $storage; @@ -33,13 +33,13 @@ class UserAuth implements UserAuthInterface { /** * Constructs a UserAuth object. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage + * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The user storage. * @param \Drupal\Core\Password\PasswordInterface $password_checker * The password service. */ public function __construct(EntityManagerInterface $entity_manager, PasswordInterface $password_checker) { - $this->storage = $entity_manager->getStorageController('user'); + $this->storage = $entity_manager->getStorage('user'); $this->passwordChecker = $password_checker; } diff --git a/core/modules/user/lib/Drupal/user/UserAutocomplete.php b/core/modules/user/lib/Drupal/user/UserAutocomplete.php index 5f27aac..05ca14d 100644 --- a/core/modules/user/lib/Drupal/user/UserAutocomplete.php +++ b/core/modules/user/lib/Drupal/user/UserAutocomplete.php @@ -89,7 +89,7 @@ public function getMatches($string, $include_anonymous = FALSE) { ->range(0, 10) ->execute(); - $controller = $this->entityManager->getStorageController('user'); + $controller = $this->entityManager->getStorage('user'); foreach ($controller->loadMultiple($uids) as $account) { $matches[] = array('value' => $account->getUsername(), 'label' => String::checkPlain($account->getUsername())); } diff --git a/core/modules/user/lib/Drupal/user/UserListBuilder.php b/core/modules/user/lib/Drupal/user/UserListBuilder.php index d2fcd3a..2f77813 100644 --- a/core/modules/user/lib/Drupal/user/UserListBuilder.php +++ b/core/modules/user/lib/Drupal/user/UserListBuilder.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityListBuilder; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Query\QueryFactory; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -33,12 +33,12 @@ class UserListBuilder extends EntityListBuilder { * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage class. * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory * The entity query factory. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, QueryFactory $query_factory) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, QueryFactory $query_factory) { parent::__construct($entity_type, $storage); $this->queryFactory = $query_factory; } @@ -49,7 +49,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageContr public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('entity.query') ); } diff --git a/core/modules/user/lib/Drupal/user/UserStorageController.php b/core/modules/user/lib/Drupal/user/UserStorage.php similarity index 92% rename from core/modules/user/lib/Drupal/user/UserStorageController.php rename to core/modules/user/lib/Drupal/user/UserStorage.php index 0694019..41e3156 100644 --- a/core/modules/user/lib/Drupal/user/UserStorageController.php +++ b/core/modules/user/lib/Drupal/user/UserStorage.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\user\UserStorageController. + * Definition of Drupal\user\UserStorage. */ namespace Drupal\user; @@ -15,15 +15,15 @@ use Drupal\field\FieldInfo; use Drupal\user\UserDataInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; /** * Controller class for users. * - * This extends the Drupal\Core\Entity\DatabaseStorageController class, adding + * This extends the Drupal\Core\Entity\DatabaseEntityStorage class, adding * required special handling for user objects. */ -class UserStorageController extends FieldableDatabaseStorageController implements UserStorageControllerInterface { +class UserStorage extends FieldableDatabaseEntityStorage implements UserStorageInterface { /** * Provides the password hashing service object. @@ -40,7 +40,7 @@ class UserStorageController extends FieldableDatabaseStorageController implement protected $userData; /** - * Constructs a new UserStorageController object. + * Constructs a new UserStorage object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. diff --git a/core/modules/user/lib/Drupal/user/UserStorageControllerInterface.php b/core/modules/user/lib/Drupal/user/UserStorageInterface.php similarity index 82% rename from core/modules/user/lib/Drupal/user/UserStorageControllerInterface.php rename to core/modules/user/lib/Drupal/user/UserStorageInterface.php index 5718f93..37b0680 100644 --- a/core/modules/user/lib/Drupal/user/UserStorageControllerInterface.php +++ b/core/modules/user/lib/Drupal/user/UserStorageInterface.php @@ -2,18 +2,18 @@ /** * @file - * Contains \Drupal\user\UserStorageControllerInterface. + * Contains \Drupal\user\UserStorageInterface. */ namespace Drupal\user; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; /** * Defines a common interface for user entity controller classes. */ -interface UserStorageControllerInterface { +interface UserStorageInterface { /** * Add any roles from the storage to the user. diff --git a/core/modules/user/tests/Drupal/user/Tests/Plugin/views/field/UserBulkFormTest.php b/core/modules/user/tests/Drupal/user/Tests/Plugin/views/field/UserBulkFormTest.php index 5f8ec1f..642aacd 100644 --- a/core/modules/user/tests/Drupal/user/Tests/Plugin/views/field/UserBulkFormTest.php +++ b/core/modules/user/tests/Drupal/user/Tests/Plugin/views/field/UserBulkFormTest.php @@ -55,8 +55,8 @@ public function testConstructor() { ->will($this->returnValue('node')); $actions[] = $action; - $storage_controller = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); - $storage_controller->expects($this->any()) + $entity_storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); + $entity_storage->expects($this->any()) ->method('loadMultiple') ->will($this->returnValue($actions)); @@ -89,7 +89,7 @@ public function testConstructor() { $definition['title'] = ''; $options = array(); - $user_bulk_form = new UserBulkForm(array(), 'user_bulk_form', $definition, $storage_controller); + $user_bulk_form = new UserBulkForm(array(), 'user_bulk_form', $definition, $entity_storage); $user_bulk_form->init($executable, $display, $options); $this->assertAttributeEquals(array_slice($actions, 0, -1, TRUE), 'actions', $user_bulk_form); diff --git a/core/modules/user/tests/Drupal/user/Tests/UserAuthTest.php b/core/modules/user/tests/Drupal/user/Tests/UserAuthTest.php index c658e60..912b541 100644 --- a/core/modules/user/tests/Drupal/user/Tests/UserAuthTest.php +++ b/core/modules/user/tests/Drupal/user/Tests/UserAuthTest.php @@ -21,9 +21,9 @@ class UserAuthTest extends UnitTestCase { /** - * The mock user storage controller. + * The mock user storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $userStorage; @@ -77,12 +77,12 @@ public static function getInfo() { * {@inheritdoc} */ public function setUp() { - $this->userStorage = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); + $this->userStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - // Getting the user storage controller should only happen once per test. + // Getting the user storage should only happen once per test. $entity_manager->expects($this->once()) - ->method('getStorageController') + ->method('getStorage') ->with('user') ->will($this->returnValue($this->userStorage)); diff --git a/core/modules/user/tests/Drupal/user/Tests/Views/Argument/RolesRidTest.php b/core/modules/user/tests/Drupal/user/Tests/Views/Argument/RolesRidTest.php index a5c9226..fabfec0 100644 --- a/core/modules/user/tests/Drupal/user/Tests/Views/Argument/RolesRidTest.php +++ b/core/modules/user/tests/Drupal/user/Tests/Views/Argument/RolesRidTest.php @@ -43,9 +43,9 @@ public function testTitleQuery() { 'label' => 'test rid 2', ), 'user_role'); - // Creates a stub entity storage controller; - $role_storage_controller = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityStorageControllerInterface'); - $role_storage_controller->expects($this->any()) + // Creates a stub entity storage; + $role_storage = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityStorageInterface'); + $role_storage->expects($this->any()) ->method('loadMultiple') ->will($this->returnValueMap(array( array(array(), array()), @@ -67,9 +67,9 @@ public function testTitleQuery() { $entity_manager ->expects($this->once()) - ->method('getStorageController') + ->method('getStorage') ->with($this->equalTo('user_role')) - ->will($this->returnValue($role_storage_controller)); + ->will($this->returnValue($role_storage)); // @todo \Drupal\Core\Entity\Entity::entityType() uses a global call to // entity_get_info(), which in turn wraps \Drupal::entityManager(). Set diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php index e188bf0..7e7c3f8 100644 --- a/core/modules/user/user.api.php +++ b/core/modules/user/user.api.php @@ -225,10 +225,10 @@ function hook_user_presave($account) { * Note that when this hook is invoked, the changes have not yet been written to * the database, because a database transaction is still in progress. The * transaction is not finalized until the insert operation is entirely completed - * and \Drupal\user\DataStorageController::save() goes out of scope. You should + * and \Drupal\user\DataStorage::save() goes out of scope. You should * not rely on data in the database at this time as it is not updated yet. You * should also note that any write/update database queries executed from this hook - * are also not committed immediately. Check \Drupal\user\DataStorageController::save() + * are also not committed immediately. Check \Drupal\user\DataStorage::save() * and db_transaction() for more info. * * @param $account @@ -252,10 +252,10 @@ function hook_user_insert($account) { * Note that when this hook is invoked, the changes have not yet been written to * the database, because a database transaction is still in progress. The * transaction is not finalized until the update operation is entirely completed - * and \Drupal\user\DataStorageController::save() goes out of scope. You should not + * and \Drupal\user\DataStorage::save() goes out of scope. You should not * rely on data in the database at this time as it is not updated yet. You should * also note that any write/update database queries executed from this hook are - * also not committed immediately. Check \Drupal\user\DataStorageController::save() + * also not committed immediately. Check \Drupal\user\DataStorage::save() * and db_transaction() for more info. * * @param $account diff --git a/core/modules/user/user.module b/core/modules/user/user.module index c1005d3..88f72d4 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -812,7 +812,7 @@ function user_login_finalize(UserInterface $account) { // This is also used to invalidate one-time login links. $account->setLastLoginTime(REQUEST_TIME); \Drupal::entityManager() - ->getStorageController('user') + ->getStorage('user') ->updateLastLoginTimestamp($account); // Regenerate the session ID to prevent against session fixation attacks. diff --git a/core/modules/views/lib/Drupal/views/Controller/ViewAjaxController.php b/core/modules/views/lib/Drupal/views/Controller/ViewAjaxController.php index cd38199..70e4a9f 100644 --- a/core/modules/views/lib/Drupal/views/Controller/ViewAjaxController.php +++ b/core/modules/views/lib/Drupal/views/Controller/ViewAjaxController.php @@ -10,7 +10,7 @@ use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Ajax\ReplaceCommand; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\views\Ajax\ScrollTopCommand; use Drupal\views\Ajax\ViewAjaxResponse; use Drupal\views\ViewExecutableFactory; @@ -25,11 +25,11 @@ class ViewAjaxController implements ContainerInjectionInterface { /** - * The entity storage controller for views. + * The entity storage for views. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The factory to load a view executable with. @@ -41,13 +41,13 @@ class ViewAjaxController implements ContainerInjectionInterface { /** * Constructs a ViewAjaxController object. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The entity storage controller for views. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage for views. * @param \Drupal\views\ViewExecutableFactory $executable_factory * The factory to load a view executable with. */ - public function __construct(EntityStorageControllerInterface $storage_controller, ViewExecutableFactory $executable_factory) { - $this->storageController = $storage_controller; + public function __construct(EntityStorageInterface $storage, ViewExecutableFactory $executable_factory) { + $this->storage = $storage; $this->executableFactory = $executable_factory; } @@ -56,7 +56,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('view'), + $container->get('entity.manager')->getStorage('view'), $container->get('views.executable') ); } @@ -95,7 +95,7 @@ public function ajaxView(Request $request) { } // Load the view. - if (!$entity = $this->storageController->load($name)) { + if (!$entity = $this->storage->load($name)) { throw new NotFoundHttpException(); } $view = $this->executableFactory->get($entity); diff --git a/core/modules/views/lib/Drupal/views/Entity/View.php b/core/modules/views/lib/Drupal/views/Entity/View.php index 097059a..c18645f 100644 --- a/core/modules/views/lib/Drupal/views/Entity/View.php +++ b/core/modules/views/lib/Drupal/views/Entity/View.php @@ -9,7 +9,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\views\Views; use Drupal\views_ui\ViewUI; use Drupal\views\ViewStorageInterface; @@ -302,8 +302,8 @@ public function calculateDependencies() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - parent::postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); // Clear cache tags for this view. // @todo Remove if views implements a view_builder controller. @@ -315,8 +315,8 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@inheritdoc} */ - public static function postLoad(EntityStorageControllerInterface $storage_controller, array &$entities) { - parent::postLoad($storage_controller, $entities); + public static function postLoad(EntityStorageInterface $storage, array &$entities) { + parent::postLoad($storage, $entities); foreach ($entities as $entity) { $entity->mergeDefaultDisplaysOptions(); } @@ -325,8 +325,8 @@ public static function postLoad(EntityStorageControllerInterface $storage_contro /** * {@inheritdoc} */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { - parent::preCreate($storage_controller, $values); + public static function preCreate(EntityStorageInterface $storage, array &$values) { + parent::preCreate($storage, $values); // If there is no information about displays available add at least the // default display. @@ -346,8 +346,8 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr /** * {@inheritdoc} */ - public function postCreate(EntityStorageControllerInterface $storage_controller) { - parent::postCreate($storage_controller); + public function postCreate(EntityStorageInterface $storage) { + parent::postCreate($storage); $this->mergeDefaultDisplaysOptions(); } @@ -355,8 +355,8 @@ public function postCreate(EntityStorageControllerInterface $storage_controller) /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { - parent::postDelete($storage_controller, $entities); + public static function postDelete(EntityStorageInterface $storage, array $entities) { + parent::postDelete($storage, $entities); $tempstore = \Drupal::service('user.tempstore')->get('views'); $tags = array(); diff --git a/core/modules/views/lib/Drupal/views/EventSubscriber/RouteSubscriber.php b/core/modules/views/lib/Drupal/views/EventSubscriber/RouteSubscriber.php index 1fdfcf0..773c09a 100644 --- a/core/modules/views/lib/Drupal/views/EventSubscriber/RouteSubscriber.php +++ b/core/modules/views/lib/Drupal/views/EventSubscriber/RouteSubscriber.php @@ -40,11 +40,11 @@ class RouteSubscriber extends RouteSubscriberBase { protected $viewsDisplayPairs; /** - * The view storage controller. + * The view storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $viewStorageController; + protected $viewStorage; /** * The state key value store. @@ -69,7 +69,7 @@ class RouteSubscriber extends RouteSubscriberBase { * The state key value store. */ public function __construct(EntityManagerInterface $entity_manager, StateInterface $state) { - $this->viewStorageController = $entity_manager->getStorageController('view'); + $this->viewStorage = $entity_manager->getStorage('view'); $this->state = $state; } @@ -136,7 +136,7 @@ public function routes() { $collection = new RouteCollection(); foreach ($this->getViewsDisplayIDsWithRoute() as $pair) { list($view_id, $display_id) = explode('.', $pair); - $view = $this->viewStorageController->load($view_id); + $view = $this->viewStorage->load($view_id); // @todo This should have an executable factory injected. if (($view = $view->getExecutable()) && $view instanceof ViewExecutable) { if ($view->setDisplay($display_id) && $display = $view->displayHandlers->get($display_id)) { @@ -158,7 +158,7 @@ public function routes() { protected function alterRoutes(RouteCollection $collection, $provider) { foreach ($this->getViewsDisplayIDsWithRoute() as $pair) { list($view_id, $display_id) = explode('.', $pair); - $view = $this->viewStorageController->load($view_id); + $view = $this->viewStorage->load($view_id); // @todo This should have an executable factory injected. if (($view = $view->getExecutable()) && $view instanceof ViewExecutable) { if ($view->setDisplay($display_id) && $display = $view->displayHandlers->get($display_id)) { diff --git a/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlockBase.php b/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlockBase.php index 3c228d1..59c2db2 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlockBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlockBase.php @@ -10,7 +10,7 @@ use Drupal\block\BlockBase; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\views\ViewExecutableFactory; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Session\AccountInterface; @@ -58,17 +58,17 @@ * The plugin implementation definition. * @param \Drupal\views\ViewExecutableFactory $executable_factory * The view executable factory. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The views storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The views storage. * @param \Drupal\Core\Session\AccountInterface $user * The current user. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, ViewExecutableFactory $executable_factory, EntityStorageControllerInterface $storage_controller, AccountInterface $user) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, ViewExecutableFactory $executable_factory, EntityStorageInterface $storage, AccountInterface $user) { $this->pluginId = $plugin_id; $delta = $this->getDerivativeId(); list($name, $this->displayID) = explode('-', $delta, 2); // Load the view. - $view = $storage_controller->load($name); + $view = $storage->load($name); $this->view = $executable_factory->get($view); $this->displaySet = $this->view->setDisplay($this->displayID); $this->user = $user; @@ -83,7 +83,7 @@ public static function create(ContainerInterface $container, array $configuratio return new static( $configuration, $plugin_id, $plugin_definition, $container->get('views.executable'), - $container->get('entity.manager')->getStorageController('view'), + $container->get('entity.manager')->getStorage('view'), $container->get('current_user') ); } diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php index 9541124..c1d753b 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php @@ -7,7 +7,7 @@ namespace Drupal\views\Plugin\Derivative; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -33,11 +33,11 @@ class ViewsBlock implements ContainerDerivativeInterface { protected $basePluginId; /** - * The view storage controller. + * The view storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $viewStorageController; + protected $viewStorage; /** * {@inheritdoc} @@ -45,7 +45,7 @@ class ViewsBlock implements ContainerDerivativeInterface { public static function create(ContainerInterface $container, $base_plugin_id) { return new static( $base_plugin_id, - $container->get('entity.manager')->getStorageController('view') + $container->get('entity.manager')->getStorage('view') ); } @@ -54,12 +54,12 @@ public static function create(ContainerInterface $container, $base_plugin_id) { * * @param string $base_plugin_id * The base plugin ID. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $view_storage_controller - * The entity storage controller to load views. + * @param \Drupal\Core\Entity\EntityStorageInterface $view_storage + * The entity storage to load views. */ - public function __construct($base_plugin_id, EntityStorageControllerInterface $view_storage_controller) { + public function __construct($base_plugin_id, EntityStorageInterface $view_storage) { $this->basePluginId = $base_plugin_id; - $this->viewStorageController = $view_storage_controller; + $this->viewStorage = $view_storage; } /** @@ -78,7 +78,7 @@ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) */ public function getDerivativeDefinitions($base_plugin_definition) { // Check all Views for block displays. - foreach ($this->viewStorageController->loadMultiple() as $view) { + foreach ($this->viewStorage->loadMultiple() as $view) { // Do not return results for disabled views. if (!$view->status()) { continue; diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php index 29439a6..f077d8e 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php @@ -8,7 +8,7 @@ namespace Drupal\views\Plugin\Derivative; use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -26,11 +26,11 @@ class ViewsExposedFilterBlock implements ContainerDerivativeInterface { protected $derivatives = array(); /** - * The view storage controller. + * The view storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $viewStorageController; + protected $viewStorage; /** * The base plugin ID that the derivative is for. @@ -44,12 +44,12 @@ class ViewsExposedFilterBlock implements ContainerDerivativeInterface { * * @param string $base_plugin_id * The base plugin ID. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $view_storage_controller - * The entity storage controller to load views. + * @param \Drupal\Core\Entity\EntityStorageInterface $view_storage + * The entity storage to load views. */ - public function __construct($base_plugin_id, EntityStorageControllerInterface $view_storage_controller) { + public function __construct($base_plugin_id, EntityStorageInterface $view_storage) { $this->basePluginId = $base_plugin_id; - $this->viewStorageController = $view_storage_controller; + $this->viewStorage = $view_storage; } /** @@ -58,7 +58,7 @@ public function __construct($base_plugin_id, EntityStorageControllerInterface $v public static function create(ContainerInterface $container, $base_plugin_id) { return new static( $base_plugin_id, - $container->get('entity.manager')->getStorageController('view') + $container->get('entity.manager')->getStorage('view') ); } @@ -78,7 +78,7 @@ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) */ public function getDerivativeDefinitions($base_plugin_definition) { // Check all Views for displays with an exposed filter block. - foreach ($this->viewStorageController->loadMultiple() as $view) { + foreach ($this->viewStorage->loadMultiple() as $view) { // Do not return results for disabled views. if (!$view->status()) { continue; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/area/View.php b/core/modules/views/lib/Drupal/views/Plugin/views/area/View.php index 9e11d4d..ce0a5ae 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/area/View.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/View.php @@ -7,7 +7,7 @@ namespace Drupal\views\Plugin\views\area; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\views\Views; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -28,9 +28,9 @@ class View extends AreaPluginBase { protected $isEmpty; /** - * The view storage controller. + * The view storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $viewStorage; @@ -43,10 +43,10 @@ class View extends AreaPluginBase { * The plugin_id for the plugin instance. * @param array $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $view_storage - * The view storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $view_storage + * The view storage. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageControllerInterface $view_storage) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $view_storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->viewStorage = $view_storage; @@ -60,7 +60,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration, $plugin_id, $plugin_definition, - $container->get('entity.manager')->getStorageController('view') + $container->get('entity.manager')->getStorage('view') ); } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Entity.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Entity.php index 1f2fd61..042363f 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Entity.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/Entity.php @@ -174,7 +174,7 @@ public function validateArgument($argument) { return FALSE; } - $entities = $this->entityManager->getStorageController($entity_type)->loadMultiple($ids); + $entities = $this->entityManager->getStorage($entity_type)->loadMultiple($ids); // Validate each id => entity. If any fails break out and return false. foreach ($ids as $id) { // There is no entity for this ID. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php index 7ae6005..ca19870 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php @@ -7,7 +7,7 @@ namespace Drupal\views\Plugin\views\field; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\views\ResultRow; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Datetime\Date as DateService; @@ -31,7 +31,7 @@ class Date extends FieldPluginBase { /** * The date format storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ protected $dateFormatStorage; @@ -46,10 +46,10 @@ class Date extends FieldPluginBase { * The plugin implementation definition. * @param \Drupal\Core\Datetime\Date $date_service * The date service. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $date_format_storage + * @param \Drupal\Core\Entity\EntityStorageInterface $date_format_storage * The date format storage. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, DateService $date_service, EntityStorageControllerInterface $date_format_storage) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, DateService $date_service, EntityStorageInterface $date_format_storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->dateService = $date_service; @@ -65,7 +65,7 @@ public static function create(ContainerInterface $container, array $configuratio $plugin_id, $plugin_definition, $container->get('date'), - $container->get('entity.manager')->getStorageController('date_format') + $container->get('entity.manager')->getStorage('date_format') ); } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/EntityLabel.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/EntityLabel.php index bc47c37..1fccfda 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/EntityLabel.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/EntityLabel.php @@ -131,7 +131,7 @@ public function preRender(&$values) { } foreach ($entity_ids_per_type as $type => $ids) { - $this->loadedReferencers[$type] = $this->entityManager->getStorageController($type)->loadMultiple($ids); + $this->loadedReferencers[$type] = $this->entityManager->getStorage($type)->loadMultiple($ids); } } diff --git a/core/modules/views/lib/Drupal/views/Routing/ViewPageController.php b/core/modules/views/lib/Drupal/views/Routing/ViewPageController.php index cd18409..3e34891 100644 --- a/core/modules/views/lib/Drupal/views/Routing/ViewPageController.php +++ b/core/modules/views/lib/Drupal/views/Routing/ViewPageController.php @@ -9,7 +9,7 @@ use Drupal\Component\Utility\String; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\views\ViewExecutableFactory; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -21,11 +21,11 @@ class ViewPageController implements ContainerInjectionInterface { /** - * The entity storage controller. + * The entity storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface + * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The view executable factory. @@ -37,13 +37,13 @@ class ViewPageController implements ContainerInjectionInterface { /** * Constructs a ViewPageController object. * - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller - * The entity storage controller. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage + * The entity storage. * @param \Drupal\views\ViewExecutableFactory $executable_factory * The view executable factory */ - public function __construct(EntityStorageControllerInterface $storage_controller, ViewExecutableFactory $executable_factory) { - $this->storageController = $storage_controller; + public function __construct(EntityStorageInterface $storage, ViewExecutableFactory $executable_factory) { + $this->storage = $storage; $this->executableFactory = $executable_factory; } @@ -52,7 +52,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorageController('view'), + $container->get('entity.manager')->getStorage('view'), $container->get('views.executable') ); } @@ -64,7 +64,7 @@ public function handle(Request $request) { $view_id = $request->attributes->get('view_id'); $display_id = $request->attributes->get('display_id'); - $entity = $this->storageController->load($view_id); + $entity = $this->storage->load($view_id); if (empty($entity)) { throw new NotFoundHttpException(String::format('Page controller for view %id requested, but view was not found.', array('%id' => $view_id))); } diff --git a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php index 208b888..6e74149 100644 --- a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php @@ -125,7 +125,7 @@ protected function setUp() { */ public function testDefaultViews() { // Get all default views. - $controller = $this->container->get('entity.manager')->getStorageController('view'); + $controller = $this->container->get('entity.manager')->getStorage('view'); $views = $controller->loadMultiple(); foreach ($views as $name => $view_storage) { diff --git a/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php b/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php index 235e5a5..1694fd0 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php @@ -79,7 +79,7 @@ protected function setUp() { */ public function testRenderers() { $values = array(); - $controller = \Drupal::entityManager()->getStorageController('node'); + $controller = \Drupal::entityManager()->getStorage('node'); $langcode_index = 0; for ($i = 0; $i < count($this->langcodes); $i++) { diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php index 81374f7..6f73d1e 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php @@ -83,7 +83,7 @@ public function testEntityArea() { for ($i = 0; $i < 3; $i++) { $random_label = $this->randomName(); $data = array('bundle' => 'entity_test', 'name' => $random_label); - $entity_test = $this->container->get('entity.manager')->getStorageController('entity_test')->create($data); + $entity_test = $this->container->get('entity.manager')->getStorage('entity_test')->create($data); $entity_test->save(); $entities[] = $entity_test; \Drupal::state()->set('entity_test_entity_access.view.' . $entity_test->id(), $i != 2); diff --git a/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php index f43edbc..e938a58 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php @@ -153,17 +153,17 @@ public function customErrorHandler($error_level, $message, $filename, $line, $co public function testLoadFunctions() { $this->enableModules(array('node')); $this->installConfig(array('node')); - $controller = $this->container->get('entity.manager')->getStorageController('view'); + $storage = $this->container->get('entity.manager')->getStorage('view'); // Test views_view_is_enabled/disabled. - $archive = $controller->load('archive'); + $archive = $storage->load('archive'); $this->assertTrue(views_view_is_disabled($archive), 'views_view_is_disabled works as expected.'); // Enable the view and check this. $archive->enable(); $this->assertTrue(views_view_is_enabled($archive), ' views_view_is_enabled works as expected.'); // We can store this now, as we have enabled/disabled above. - $all_views = $controller->loadMultiple(); + $all_views = $storage->loadMultiple(); // Test Views::getAllViews(). $this->assertIdentical(array_keys($all_views), array_keys(Views::getAllViews()), 'Views::getAllViews works as expected.'); diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTagTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTagTest.php index c183e57..f96354f 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTagTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/CacheTagTest.php @@ -31,11 +31,11 @@ class CacheTagTest extends PluginTestBase { public static $modules = array('node'); /** - * The node storage controller. + * The node storage. * - * @var \Drupal\node\NodeStorageController + * @var \Drupal\node\NodeStorage */ - protected $nodeStorageController; + protected $nodeStorage; /** * The node view builder. @@ -86,7 +86,7 @@ protected function setUp() { $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); - $this->nodeStorageController = $this->container->get('entity.manager')->getStorageController('node'); + $this->nodeStorage = $this->container->get('entity.manager')->getStorage('node'); $this->nodeViewBuilder = $this->container->get('entity.manager')->getViewBuilder('node'); $this->userViewBuilder = $this->container->get('entity.manager')->getViewBuilder('user'); diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php index fe101d8..34403c8 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayFeedTest.php @@ -96,7 +96,7 @@ public function testFeedOutput() { $result = $this->xpath('//title'); $this->assertEqual($result[0], $site_name, 'The site title is used for the feed title.'); - $view = $this->container->get('entity.manager')->getStorageController('view')->load('test_display_feed'); + $view = $this->container->get('entity.manager')->getStorage('view')->load('test_display_feed'); $display = &$view->getDisplay('feed_1'); $display['display_options']['sitename_title'] = 0; $view->save(); diff --git a/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php b/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php index b35f020..5ef6c5e 100644 --- a/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php @@ -29,11 +29,11 @@ class QueryGroupByTest extends ViewUnitTestBase { public static $modules = array('entity', 'entity_test', 'system', 'field', 'user'); /** - * The storage controller for the test entity type. + * The storage for the test entity type. * - * @var \Drupal\Core\Entity\FieldableDatabaseStorageController + * @var \Drupal\Core\Entity\FieldableDatabaseEntityStorage */ - public $storageController; + public $storage; public static function getInfo() { return array( @@ -51,7 +51,7 @@ protected function setUp() { $this->installSchema('entity_test', array('entity_test')); - $this->storageController = $this->container->get('entity.manager')->getStorageController('entity_test'); + $this->storage = $this->container->get('entity.manager')->getStorage('entity_test'); } @@ -111,17 +111,17 @@ protected function setupTestEntities() { 'name' => 'name1', ); - $this->storageController->create($entity_1)->save(); - $this->storageController->create($entity_1)->save(); - $this->storageController->create($entity_1)->save(); - $this->storageController->create($entity_1)->save(); + $this->storage->create($entity_1)->save(); + $this->storage->create($entity_1)->save(); + $this->storage->create($entity_1)->save(); + $this->storage->create($entity_1)->save(); $entity_2 = array( 'name' => 'name2', ); - $this->storageController->create($entity_2)->save(); - $this->storageController->create($entity_2)->save(); - $this->storageController->create($entity_2)->save(); + $this->storage->create($entity_2)->save(); + $this->storage->create($entity_2)->save(); + $this->storage->create($entity_2)->save(); } /** @@ -167,7 +167,7 @@ public function testGroupByCountOnlyFilters() { // Doesn't display SUM, COUNT, MAX... functions in SELECT statement for ($x = 0; $x < 10; $x++) { - $this->storageController->create(array('name' => 'name1'))->save(); + $this->storage->create(array('name' => 'name1'))->save(); } $view = Views::getView('test_group_by_in_filters'); diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php index 6c97e99..6a9229b 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php @@ -254,7 +254,7 @@ public function testDisplays() { $this->assertTrue($view->rowPlugin instanceof Fields); // Test the newDisplay() method. - $view = $this->container->get('entity.manager')->getStorageController('view')->create(array('id' => 'test_executable_displays')); + $view = $this->container->get('entity.manager')->getStorage('view')->create(array('id' => 'test_executable_displays')); $executable = $view->getExecutable(); $executable->newDisplay('page'); diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php index ba14380..d28a99e 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php @@ -8,7 +8,7 @@ namespace Drupal\views\Tests; use Drupal\Core\Entity\EntityTypeInterface; -use Drupal\Core\Config\Entity\ConfigStorageController; +use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\views\Entity\View; use Drupal\views\Plugin\views\display\Page; use Drupal\views\Plugin\views\display\DefaultDisplay; @@ -16,10 +16,10 @@ use Drupal\views\Views; /** - * Tests the functionality of View and ConfigStorageController. + * Tests the functionality of View and ConfigStorage. * * @see \Drupal\views\Entity\View - * @see \Drupal\Core\Config\Entity\ConfigStorageController + * @see \Drupal\Core\Config\Entity\ConfigEntityStorage */ class ViewStorageTest extends ViewUnitTestBase { @@ -48,9 +48,9 @@ class ViewStorageTest extends ViewUnitTestBase { protected $entityType; /** - * The configuration entity storage controller. + * The configuration entity storage. * - * @var \Drupal\Core\Config\Entity\ConfigStorageController + * @var \Drupal\Core\Config\Entity\ConfigEntityStorage */ protected $controller; @@ -75,7 +75,7 @@ public static function getInfo() { function testConfigurationEntityCRUD() { // Get the configuration entity type and controller. $this->entityType = \Drupal::entityManager()->getDefinition('view'); - $this->controller = $this->container->get('entity.manager')->getStorageController('view'); + $this->controller = $this->container->get('entity.manager')->getStorage('view'); // Confirm that an info array has been returned. $this->assertTrue($this->entityType instanceof EntityTypeInterface, 'The View info array is loaded.'); diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php b/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php index 1117bd8..97f2d66 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php @@ -36,7 +36,7 @@ public static function createTestViews($class, array $modules) { $class = get_parent_class($class); } if (!empty($views)) { - $storage_controller = \Drupal::entityManager()->getStorageController('view'); + $storage = \Drupal::entityManager()->getStorage('view'); $module_handler = \Drupal::moduleHandler(); foreach ($modules as $module) { $config_dir = drupal_get_path('module', $module) . '/test_views'; @@ -48,7 +48,7 @@ public static function createTestViews($class, array $modules) { foreach ($file_storage->listAll('views.view.') as $config_name) { $id = str_replace('views.view.', '', $config_name); if (in_array($id, $views)) { - $storage_controller + $storage ->create($file_storage->read($config_name)) ->save(); } @@ -270,4 +270,3 @@ public static function dataSet() { } } - diff --git a/core/modules/views/lib/Drupal/views/Views.php b/core/modules/views/lib/Drupal/views/Views.php index 40c5cd1..3a46f67 100644 --- a/core/modules/views/lib/Drupal/views/Views.php +++ b/core/modules/views/lib/Drupal/views/Views.php @@ -85,7 +85,7 @@ public static function handlerManager($type) { * A view executable instance, from the loaded entity. */ public static function getView($id) { - $view = \Drupal::service('entity.manager')->getStorageController('view')->load($id); + $view = \Drupal::service('entity.manager')->getStorage('view')->load($id); if ($view) { return static::executableFactory()->get($view); } @@ -184,7 +184,7 @@ public static function getApplicableViews($type) { ->execute(); $result = array(); - foreach (\Drupal::entityManager()->getStorageController('view')->loadMultiple($entity_ids) as $view) { + foreach (\Drupal::entityManager()->getStorage('view')->loadMultiple($entity_ids) as $view) { // Check each display to see if it meets the criteria and is enabled. $executable = $view->getExecutable(); $executable->initDisplay(); @@ -205,7 +205,7 @@ public static function getApplicableViews($type) { * An array of loaded view entities. */ public static function getAllViews() { - return \Drupal::entityManager()->getStorageController('view')->loadMultiple(); + return \Drupal::entityManager()->getStorage('view')->loadMultiple(); } /** @@ -219,7 +219,7 @@ public static function getEnabledViews() { ->condition('status', TRUE) ->execute(); - return \Drupal::entityManager()->getStorageController('view')->loadMultiple($query); + return \Drupal::entityManager()->getStorage('view')->loadMultiple($query); } /** @@ -233,7 +233,7 @@ public static function getDisabledViews() { ->condition('status', FALSE) ->execute(); - return \Drupal::entityManager()->getStorageController('view')->loadMultiple($query); + return \Drupal::entityManager()->getStorage('view')->loadMultiple($query); } /** diff --git a/core/modules/views/tests/Drupal/views/Tests/Controller/ViewAjaxControllerTest.php b/core/modules/views/tests/Drupal/views/Tests/Controller/ViewAjaxControllerTest.php index da1245b..588eec7 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Controller/ViewAjaxControllerTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Controller/ViewAjaxControllerTest.php @@ -26,7 +26,7 @@ class ViewAjaxControllerTest extends UnitTestCase { /** * The mocked view entity storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $viewStorage; @@ -53,7 +53,7 @@ public static function getInfo() { } protected function setUp() { - $this->viewStorage = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); + $this->viewStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); $this->executableFactory = $this->getMockBuilder('Drupal\views\ViewExecutableFactory') ->disableOriginalConstructor() ->getMock(); diff --git a/core/modules/views/tests/Drupal/views/Tests/EventSubscriber/RouteSubscriberTest.php b/core/modules/views/tests/Drupal/views/Tests/EventSubscriber/RouteSubscriberTest.php index cccd842..6afc025 100644 --- a/core/modules/views/tests/Drupal/views/Tests/EventSubscriber/RouteSubscriberTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/EventSubscriber/RouteSubscriberTest.php @@ -28,11 +28,11 @@ class RouteSubscriberTest extends UnitTestCase { protected $entityManager; /** - * The mocked view storage controller. + * The mocked view storage. * - * @var \Drupal\views\ViewStorageController|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\views\ViewStorage|\PHPUnit_Framework_MockObject_MockObject */ - protected $viewStorageController; + protected $viewStorage; /** * The tested views route subscriber. @@ -61,13 +61,13 @@ public static function getInfo() { protected function setUp() { $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - $this->viewStorageController = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigStorageController') + $this->viewStorage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage') ->disableOriginalConstructor() ->getMock(); $this->entityManager->expects($this->any()) - ->method('getStorageController') + ->method('getStorage') ->with('view') - ->will($this->returnValue($this->viewStorageController)); + ->will($this->returnValue($this->viewStorage)); $this->state = $this->getMock('\Drupal\Core\KeyValueStore\StateInterface'); $this->routeSubscriber = new TestRouteSubscriber($this->entityManager, $this->state); } @@ -152,7 +152,7 @@ protected function setupMocks() { $view = $this->getMockBuilder('Drupal\views\Entity\View') ->disableOriginalConstructor() ->getMock(); - $this->viewStorageController->expects($this->any()) + $this->viewStorage->expects($this->any()) ->method('load') ->will($this->returnValue($view)); diff --git a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php index ff9bc33..55b1826 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php @@ -45,11 +45,11 @@ class ViewsBlockTest extends UnitTestCase { protected $view; /** - * The view storage controller. + * The view storage. * - * @var \Drupal\Core\Entity\EntityStorageControllerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Entity\EntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $storageController; + protected $storage; /** * The mocked user account. @@ -98,11 +98,11 @@ protected function setUp() { ->with($this->view) ->will($this->returnValue($this->executable)); - $this->storageController = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigStorageController') + $this->storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage') ->disableOriginalConstructor() ->getMock(); - $this->storageController->expects($this->any()) + $this->storage->expects($this->any()) ->method('load') ->with('test_view') ->will($this->returnValue($this->view)); @@ -126,7 +126,7 @@ public function testBuild() { $config = array(); $definition = array(); $definition['module'] = 'views'; - $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storageController, $this->account); + $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storage, $this->account); $this->assertEquals($build, $plugin->build()); } @@ -147,7 +147,7 @@ public function testBuildFailed() { $config = array(); $definition = array(); $definition['module'] = 'views'; - $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storageController, $this->account); + $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storage, $this->account); $this->assertEquals(array(), $plugin->build()); } diff --git a/core/modules/views/tests/Drupal/views/Tests/Plugin/argument_validator/EntityTest.php b/core/modules/views/tests/Drupal/views/Tests/Plugin/argument_validator/EntityTest.php index c6a9104..f56fa1f 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Plugin/argument_validator/EntityTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Plugin/argument_validator/EntityTest.php @@ -93,7 +93,7 @@ protected function setUp() { ))); - $storage_controller = $this->getMock('Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); // Setup values for IDs passed as strings or numbers. $value_map = array( @@ -105,13 +105,13 @@ protected function setUp() { array(array(2), array(2 => $mock_entity_bundle_2)), array(array('2'), array(2 => $mock_entity_bundle_2)), ); - $storage_controller->expects($this->any()) + $storage->expects($this->any()) ->method('loadMultiple') ->will($this->returnValueMap($value_map)); $this->entityManager->expects($this->any()) - ->method('getStorageController') - ->will($this->returnValue($storage_controller)); + ->method('getStorage') + ->will($this->returnValue($storage)); $this->executable = $this->getMockBuilder('Drupal\views\ViewExecutable') ->disableOriginalConstructor() diff --git a/core/modules/views/tests/Drupal/views/Tests/Routing/ViewPageControllerTest.php b/core/modules/views/tests/Drupal/views/Tests/Routing/ViewPageControllerTest.php index 0daf925..4a52eac 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Routing/ViewPageControllerTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Routing/ViewPageControllerTest.php @@ -31,11 +31,11 @@ class ViewPageControllerTest extends UnitTestCase { public $pageController; /** - * The mocked view storage controller. + * The mocked view storage. * - * @var \Drupal\views\ViewStorageController|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\views\ViewStorage|\PHPUnit_Framework_MockObject_MockObject */ - protected $storageController; + protected $storage; /** * The mocked view executable factory. @@ -53,14 +53,14 @@ public static function getInfo() { } protected function setUp() { - $this->storageController = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigStorageController') + $this->storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage') ->disableOriginalConstructor() ->getMock(); $this->executableFactory = $this->getMockBuilder('Drupal\views\ViewExecutableFactory') ->disableOriginalConstructor() ->getMock(); - $this->pageController = new ViewPageController($this->storageController, $this->executableFactory); + $this->pageController = new ViewPageController($this->storage, $this->executableFactory); } /** @@ -69,7 +69,7 @@ protected function setUp() { public function testPageController() { $view = $this->getMock('Drupal\views\ViewStorageInterface'); - $this->storageController->expects($this->once()) + $this->storage->expects($this->once()) ->method('load') ->with('test_page_view') ->will($this->returnValue($view)); @@ -107,7 +107,7 @@ public function testPageController() { public function testHandleWithArgumentsWithoutOverridden() { $view = $this->getMock('Drupal\views\ViewStorageInterface'); - $this->storageController->expects($this->once()) + $this->storage->expects($this->once()) ->method('load') ->with('test_page_view') ->will($this->returnValue($view)); @@ -153,7 +153,7 @@ public function testHandleWithArgumentsWithoutOverridden() { public function testHandleWithArgumentsOnOveriddenRoute() { $view = $this->getMock('Drupal\views\ViewStorageInterface'); - $this->storageController->expects($this->once()) + $this->storage->expects($this->once()) ->method('load') ->with('test_page_view') ->will($this->returnValue($view)); @@ -203,7 +203,7 @@ public function testHandleWithArgumentsOnOveriddenRoute() { public function testHandleWithArgumentsOnOveriddenRouteWithUpcasting() { $view = $this->getMock('Drupal\views\ViewStorageInterface'); - $this->storageController->expects($this->once()) + $this->storage->expects($this->once()) ->method('load') ->with('test_page_view') ->will($this->returnValue($view)); diff --git a/core/modules/views/tests/Drupal/views/Tests/ViewsTest.php b/core/modules/views/tests/Drupal/views/Tests/ViewsTest.php index 1ebf244..61c3850 100644 --- a/core/modules/views/tests/Drupal/views/Tests/ViewsTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/ViewsTest.php @@ -35,19 +35,19 @@ protected function setUp() { $this->view = new View(array('id' => 'test_view'), 'view'); - $view_storage_controller = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigStorageController') + $view_storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage') ->disableOriginalConstructor() ->getMock(); - $view_storage_controller->expects($this->once()) + $view_storage->expects($this->once()) ->method('load') ->with('test_view') ->will($this->returnValue($this->view)); $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); $entity_manager->expects($this->once()) - ->method('getStorageController') + ->method('getStorage') ->with('view') - ->will($this->returnValue($view_storage_controller)); + ->will($this->returnValue($view_storage)); $container->set('entity.manager', $entity_manager); \Drupal::setContainer($container); diff --git a/core/modules/views/views.views.inc b/core/modules/views/views.views.inc index d11c4d7..9775c61 100644 --- a/core/modules/views/views.views.inc +++ b/core/modules/views/views.views.inc @@ -132,7 +132,7 @@ function views_views_data() { // Registers an action bulk form per entity. foreach (\Drupal::entityManager()->getDefinitions() as $entity_type => $entity_info) { - $actions = array_filter(\Drupal::entityManager()->getStorageController('action')->loadMultiple(), function (ActionConfigEntityInterface $action) use ($entity_type) { + $actions = array_filter(\Drupal::entityManager()->getStorage('action')->loadMultiple(), function (ActionConfigEntityInterface $action) use ($entity_type) { return $action->getType() == $entity_type; }); if (empty($actions)) { diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php index cc6b037..a613e76 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php @@ -58,7 +58,7 @@ public static function create(ContainerInterface $container) { * The Views fields report page. */ public function reportFields() { - $views = $this->entityManager()->getStorageController('view')->loadMultiple(); + $views = $this->entityManager()->getStorage('view')->loadMultiple(); // Fetch all fieldapi fields which are used in views // Therefore search in all views, displays and handler-types. @@ -177,7 +177,7 @@ public function autocompleteTag(Request $request) { $matches = array(); $string = $request->query->get('q'); // Get matches from default views. - $views = $this->entityManager()->getStorageController('view')->loadMultiple(); + $views = $this->entityManager()->getStorage('view')->loadMultiple(); foreach ($views as $view) { $tag = $view->get('tag'); if ($tag && strpos($tag, $string) === 0) { diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php index 2af481f..52501ef 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/BreakLockForm.php @@ -73,7 +73,7 @@ public function getQuestion() { */ public function getDescription() { $locked = $this->tempStore->getMetadata($this->entity->id()); - $account = $this->entityManager->getStorageController('user')->load($locked->owner); + $account = $this->entityManager->getStorage('user')->load($locked->owner); $username = array( '#theme' => 'username', '#account' => $account, diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php index 08d5673..7a5d615 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php @@ -52,7 +52,7 @@ function testGroupBySave() { $this->drupalPostForm(NULL, array(), t('Save')); - $view = $this->container->get('entity.manager')->getStorageController('view')->load('test_views_groupby_save'); + $view = $this->container->get('entity.manager')->getStorage('view')->load('test_views_groupby_save'); $display = $view->getDisplay('default'); $this->assertTrue($display['display_options']['group_by'], 'The groupby setting was saved on the view.'); $this->assertEqual($display['display_options']['fields']['id']['group_type'], 'count', 'Count groupby_type was saved on the view.'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php index 176f009..68d841b 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php @@ -109,7 +109,7 @@ public function testUICRUD() { // Save the view and have a look whether the handler was added as expected. $this->drupalPostForm(NULL, array(), t('Save')); - $view = $this->container->get('entity.manager')->getStorageController('view')->load('test_view_empty'); + $view = $this->container->get('entity.manager')->getStorage('view')->load('test_view_empty'); $display = $view->getDisplay('default'); $this->assertTrue(isset($display['display_options'][$type_info['plural']][$id]), 'Ensure the field was added to the view itself.'); @@ -118,7 +118,7 @@ public function testUICRUD() { $this->assertNoLinkByHref($edit_handler_url, 0, 'The handler edit link does not appears in the UI after removing.'); $this->drupalPostForm(NULL, array(), t('Save')); - $view = $this->container->get('entity.manager')->getStorageController('view')->load('test_view_empty'); + $view = $this->container->get('entity.manager')->getStorage('view')->load('test_view_empty'); $display = $view->getDisplay('default'); $this->assertFalse(isset($display['display_options'][$type_info['plural']][$id]), 'Ensure the field was removed from the view itself.'); } @@ -139,7 +139,7 @@ public function testUICRUD() { $this->drupalPostForm(NULL, array(), t('Apply')); $this->drupalPostForm(NULL, array(), t('Save')); - $view = $this->container->get('entity.manager')->getStorageController('view')->load('test_view_empty'); + $view = $this->container->get('entity.manager')->getStorage('view')->load('test_view_empty'); $display = $view->getDisplay('default'); $this->assertTrue(isset($display['display_options'][$type_info['plural']][$id]), 'Ensure the field was added to the view itself.'); } diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php index e1036a0..147e769 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php @@ -43,7 +43,7 @@ public function testDeleteLink() { $this->drupalPostForm(NULL, array(), t('Delete')); $this->assertUrl('admin/structure/views'); - $view = $this->container->get('entity.manager')->getStorageController('view')->load('test_view'); + $view = $this->container->get('entity.manager')->getStorage('view')->load('test_view'); $this->assertFalse($view instanceof View); } @@ -62,7 +62,7 @@ public function testMachineNameOption() { // Save the view, and test the new ID has been saved. $this->drupalPostForm(NULL, array(), 'Save'); - $view = \Drupal::entityManager()->getStorageController('view')->load('test_view'); + $view = \Drupal::entityManager()->getStorage('view')->load('test_view'); $displays = $view->get('display'); $this->assertTrue(!empty($displays['test_1']), 'Display data found for new display ID key.'); $this->assertIdentical($displays['test_1']['id'], 'test_1', 'New display ID matches the display ID key.'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewListBuilder.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewListBuilder.php index 36f20c3..6501c63 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewListBuilder.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListBuilder.php @@ -11,7 +11,7 @@ use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Config\Entity\ConfigEntityListBuilder; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -35,7 +35,7 @@ class ViewListBuilder extends ConfigEntityListBuilder { public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorageController($entity_type->id()), + $container->get('entity.manager')->getStorage($entity_type->id()), $container->get('plugin.manager.views.display') ); } @@ -45,12 +45,12 @@ public static function createInstance(ContainerInterface $container, EntityTypeI * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage. - * The entity storage controller class. + * @param \Drupal\Core\Entity\EntityStorageInterface $storage. + * The entity storage class. * @param \Drupal\Component\Plugin\PluginManagerInterface $display_manager * The views display plugin manager to use. */ - public function __construct(EntityTypeInterface $entity_type, EntityStorageControllerInterface $storage, PluginManagerInterface $display_manager) { + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, PluginManagerInterface $display_manager) { parent::__construct($entity_type, $storage); $this->displayManager = $display_manager; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php index 009e8e4..a90d030 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php @@ -10,7 +10,7 @@ use Drupal\Component\Utility\String; use Drupal\Component\Utility\Timer; use Drupal\views\Views; -use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\views\ViewExecutable; use Drupal\Core\Database\Database; use Drupal\Core\TypedData\TypedDataInterface; @@ -1123,46 +1123,46 @@ public function applyDefaultValue($notify = TRUE) { /** * {@inheritdoc} */ - public function preSave(EntityStorageControllerInterface $storage_controller) { - $this->storage->presave($storage_controller); + public function preSave(EntityStorageInterface $storage) { + $this->storage->presave($storage); } /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { - $this->storage->postSave($storage_controller, $update); + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + $this->storage->postSave($storage, $update); } /** * {@inheritdoc} */ - public static function preCreate(EntityStorageControllerInterface $storage_controller, array &$values) { + public static function preCreate(EntityStorageInterface $storage, array &$values) { } /** * {@inheritdoc} */ - public function postCreate(EntityStorageControllerInterface $storage_controller) { - $this->storage->postCreate($storage_controller); + public function postCreate(EntityStorageInterface $storage) { + $this->storage->postCreate($storage); } /** * {@inheritdoc} */ - public static function preDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + public static function preDelete(EntityStorageInterface $storage, array $entities) { } /** * {@inheritdoc} */ - public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { + public static function postDelete(EntityStorageInterface $storage, array $entities) { } /** * {@inheritdoc} */ - public static function postLoad(EntityStorageControllerInterface $storage_controller, array &$entities) { + public static function postLoad(EntityStorageInterface $storage, array &$entities) { } /** diff --git a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListBuilderTest.php b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListBuilderTest.php index 99216db..167d1d3 100644 --- a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListBuilderTest.php +++ b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListBuilderTest.php @@ -30,7 +30,7 @@ public static function getInfo() { * @see \Drupal\views_ui\ViewListBuilder::getDisplaysList() */ public function testBuildRowEntityList() { - $storage_controller = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigStorageController') + $storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage') ->disableOriginalConstructor() ->getMock(); $display_manager = $this->getMockBuilder('\Drupal\views\Plugin\ViewsPluginManager') @@ -124,7 +124,7 @@ public function testBuildRowEntityList() { // Setup a view list builder with a mocked buildOperations method, // because t() is called on there. $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface'); - $view_list_builder = new TestViewListBuilder($entity_type, $storage_controller, $display_manager); + $view_list_builder = new TestViewListBuilder($entity_type, $storage, $display_manager); $view_list_builder->setTranslationManager($this->getStringTranslationStub()); $view = new View($values, 'view'); diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/PhpStorageTestBase.php b/core/tests/Drupal/Tests/Component/PhpStorage/PhpStorageTestBase.php index 8fd6269..85ba619 100644 --- a/core/tests/Drupal/Tests/Component/PhpStorage/PhpStorageTestBase.php +++ b/core/tests/Drupal/Tests/Component/PhpStorage/PhpStorageTestBase.php @@ -11,7 +11,7 @@ use Drupal\Component\PhpStorage\PhpStorageFactory; /** - * Base test for PHP storage controllers. + * Base test for PHP storages. */ abstract class PhpStorageTestBase extends UnitTestCase { @@ -32,7 +32,7 @@ function setUp() { } /** - * Assert that a PHP storage controller's load/save/delete operations work. + * Assert that a PHP storage's load/save/delete operations work. */ public function assertCRUD($php) { $name = $this->randomName() . '/' . $this->randomName() . '.php'; diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php index 9deeaa6..dcdfb76 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php @@ -142,7 +142,7 @@ public function testCalculateDependencies() { */ public function testPreSaveDuringSync() { $query = $this->getMock('\Drupal\Core\Entity\Query\QueryInterface'); - $storage = $this->getMock('\Drupal\Core\Config\Entity\ConfigStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Config\Entity\ConfigEntityStorageInterface'); $query->expects($this->any()) ->method('execute') diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php index 9eb55ae..a9700bd 100644 --- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php @@ -210,7 +210,7 @@ public function testIsTranslatable() { */ public function testPreSaveRevision() { // This method is internal, so check for errors on calling it only. - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $record = new \stdClass(); $this->entity->preSaveRevision($storage, $record); } diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php index 0d9881f..b413675 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php @@ -49,10 +49,10 @@ protected function setUp() { parent::setUp(); $this->role = $this->getMock('Drupal\user\RoleInterface'); - $role_storage_controller = $this->getMock('Drupal\user\RoleStorageControllerInterface'); + $role_storage = $this->getMock('Drupal\user\RoleStorageInterface'); $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface'); - $this->entityListBuilder = new TestEntityListBuilder($entity_type, $role_storage_controller, $module_handler); + $this->entityListBuilder = new TestEntityListBuilder($entity_type, $role_storage, $module_handler); } /** diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php index 4414904..7296868 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php @@ -260,11 +260,11 @@ public function providerTestHasController() { } /** - * Tests the getStorageController() method. + * Tests the getStorage() method. * - * @covers ::getStorageController() + * @covers ::getStorage() */ - public function testGetStorageController() { + public function testGetStorage() { $class = $this->getTestControllerClass(); $entity = $this->getMock('Drupal\Core\Entity\EntityTypeInterface'); $entity->expects($this->once()) @@ -272,7 +272,7 @@ public function testGetStorageController() { ->will($this->returnValue($class)); $this->setUpEntityManager(array('test_entity_type' => $entity)); - $this->assertInstanceOf($class, $this->entityManager->getStorageController('test_entity_type')); + $this->assertInstanceOf($class, $this->entityManager->getStorage('test_entity_type')); } /** diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php index be09ad8..47c9ad4 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php @@ -233,12 +233,12 @@ public function testLanguage() { * @covers ::save */ public function testSave() { - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $storage->expects($this->once()) ->method('save') ->with($this->entity); $this->entityManager->expects($this->once()) - ->method('getStorageController') + ->method('getStorage') ->with($this->entityTypeId) ->will($this->returnValue($storage)); $this->entity->save(); @@ -249,12 +249,12 @@ public function testSave() { */ public function testDelete() { $this->entity->id = $this->randomName(); - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); // Testing the argument of the delete() method consumes too much memory. $storage->expects($this->once()) ->method('delete'); $this->entityManager->expects($this->once()) - ->method('getStorageController') + ->method('getStorage') ->with($this->entityTypeId) ->will($this->returnValue($storage)); $this->entity->delete(); @@ -272,7 +272,7 @@ public function testGetEntityTypeId() { */ public function testPreSave() { // This method is internal, so check for errors on calling it only. - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $this->entity->preSave($storage); } @@ -281,7 +281,7 @@ public function testPreSave() { */ public function testPostSave() { // This method is internal, so check for errors on calling it only. - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $this->entity->postSave($storage); } @@ -290,7 +290,7 @@ public function testPostSave() { */ public function testPreCreate() { // This method is internal, so check for errors on calling it only. - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $values = array(); $this->entity->preCreate($storage, $values); } @@ -300,7 +300,7 @@ public function testPreCreate() { */ public function testPostCreate() { // This method is internal, so check for errors on calling it only. - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $this->entity->postCreate($storage); } @@ -309,7 +309,7 @@ public function testPostCreate() { */ public function testPreDelete() { // This method is internal, so check for errors on calling it only. - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $this->entity->preDelete($storage, array($this->entity)); } @@ -317,7 +317,7 @@ public function testPreDelete() { * @covers ::postDelete */ public function testPostDelete() { - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $entity = $this->getMockBuilder('\Drupal\Core\Entity\Entity') ->setMethods(array('onSaveOrDelete')) @@ -334,7 +334,7 @@ public function testPostDelete() { */ public function testPostLoad() { // This method is internal, so check for errors on calling it only. - $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageControllerInterface'); + $storage = $this->getMock('\Drupal\Core\Entity\EntityStorageInterface'); $entities = array($this->entity); $this->entity->postLoad($storage, $entities); } diff --git a/core/tests/Drupal/Tests/Core/Entity/FieldableDatabaseStorageControllerTest.php b/core/tests/Drupal/Tests/Core/Entity/FieldableDatabaseEntityStorageTest.php similarity index 86% rename from core/tests/Drupal/Tests/Core/Entity/FieldableDatabaseStorageControllerTest.php rename to core/tests/Drupal/Tests/Core/Entity/FieldableDatabaseEntityStorageTest.php index 33b51da..07eba27 100644 --- a/core/tests/Drupal/Tests/Core/Entity/FieldableDatabaseStorageControllerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/FieldableDatabaseEntityStorageTest.php @@ -2,33 +2,33 @@ /** * @file - * Contains \Drupal\Tests\Core\Entity\FieldableDatabaseStorageControllerTest. + * Contains \Drupal\Tests\Core\Entity\FieldableDatabaseEntityStorageTest. */ namespace Drupal\Tests\Core\Entity; use Drupal\Core\Entity\EntityType; -use Drupal\Core\Entity\FieldableDatabaseStorageController; +use Drupal\Core\Entity\FieldableDatabaseEntityStorage; use Drupal\Core\Field\FieldDefinition; use Drupal\Tests\UnitTestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; /** - * Tests the fieldable database storage controller. + * Tests the fieldable database storage. * - * @see \Drupal\Core\Entity\FieldableDatabaseStorageController + * @see \Drupal\Core\Entity\FieldableDatabaseEntityStorage * * @group Drupal * @group Entity */ -class FieldableDatabaseStorageControllerTest extends UnitTestCase { +class FieldableDatabaseEntityStorageTest extends UnitTestCase { /** * {@inheritdoc} */ public static function getInfo() { return array( - 'name' => 'Fieldable database storage controller', + 'name' => 'Fieldable database storage', 'description' => 'Tests the fieldable database storage enhancer for entities.', 'group' => 'Entity' ); @@ -37,7 +37,7 @@ public static function getInfo() { /** * Tests field SQL schema generation for an entity with a string identifier. * - * @see \Drupal\Core\Entity\Controller\FieldableDatabaseStorageController::_fieldSqlSchema() + * @see \Drupal\Core\Entity\Controller\FieldableDatabaseEntityStorage::_fieldSqlSchema() */ public function testFieldSqlSchemaForEntityWithStringIdentifier() { $field_type_manager = $this->getMock('Drupal\Core\Field\FieldTypePluginManagerInterface'); @@ -106,7 +106,7 @@ public function testFieldSqlSchemaForEntityWithStringIdentifier() { ->method('getSchema') ->will($this->returnValue($field_schema)); - $schema = FieldableDatabaseStorageController::_fieldSqlSchema($field); + $schema = FieldableDatabaseEntityStorage::_fieldSqlSchema($field); // Make sure that the entity_id schema field if of type varchar. $this->assertEquals($schema['test_entity__test_field']['fields']['entity_id']['type'], 'varchar'); diff --git a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php index dfaa5d3..b01e3b2 100644 --- a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php +++ b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php @@ -91,7 +91,7 @@ protected function setUp() { array('last example permission', FALSE), ))); - $role_storage = $this->getMockBuilder('Drupal\user\RoleStorageController') + $role_storage = $this->getMockBuilder('Drupal\user\RoleStorage') ->disableOriginalConstructor() ->setMethods(array('loadMultiple')) ->getMock(); @@ -107,7 +107,7 @@ protected function setUp() { $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); $entity_manager->expects($this->any()) - ->method('getStorageController') + ->method('getStorage') ->with($this->equalTo('user_role')) ->will($this->returnValue($role_storage)); $container = new ContainerBuilder();