diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php index e8f8088..7ff1a46 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/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/modules/action/lib/Drupal/action/ActionFormControllerBase.php b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php index e80a15e..99363fd 100644 --- a/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php +++ b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php @@ -29,7 +29,7 @@ * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * Constructs a new action form. @@ -38,7 +38,7 @@ * The action storage controller. */ public function __construct(EntityStorageInterface $storage) { - $this->storageController = $storage; + $this->storage = $storage; } /** @@ -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/Plugin/Action/EmailAction.php b/core/modules/action/lib/Drupal/action/Plugin/Action/EmailAction.php index b5b603b..8e9b85d 100644 --- a/core/modules/action/lib/Drupal/action/Plugin/Action/EmailAction.php +++ b/core/modules/action/lib/Drupal/action/Plugin/Action/EmailAction.php @@ -36,7 +36,7 @@ class EmailAction extends ConfigurableActionBase implements ContainerFactoryPlug * * @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->getStorage('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/Plugin/Block/AggregatorFeedBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php index 40f0740..bf0a97d 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php @@ -30,7 +30,7 @@ class AggregatorFeedBlock extends BlockBase implements ContainerFactoryPluginInt * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The database connection. @@ -55,7 +55,7 @@ class AggregatorFeedBlock extends BlockBase implements ContainerFactoryPluginInt */ public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage, Connection $connection) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->storageController = $storage; + $this->storage = $storage; $this->connection = $connection; } @@ -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/book/lib/Drupal/book/BookManager.php b/core/modules/book/lib/Drupal/book/BookManager.php index 2ff106b..b474abb 100644 --- a/core/modules/book/lib/Drupal/book/BookManager.php +++ b/core/modules/book/lib/Drupal/book/BookManager.php @@ -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/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/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php index 3c985ae..888d52d 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 @@ -41,7 +41,7 @@ class CommentDefaultFormatter extends FormatterBase implements ContainerFactoryP * * @var \Drupal\comment\CommentStorageInterface */ - protected $storageController; + protected $storage; /** * The current user. @@ -99,7 +99,7 @@ public static function create(ContainerInterface $container, array $configuratio 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; + $this->storage = $comment_storage; $this->currentUser = $current_user; } @@ -131,7 +131,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 020e1ab..a2b17c5 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/entity/lib/Drupal/entity/Entity/EntityFormMode.php b/core/modules/entity/lib/Drupal/entity/Entity/EntityFormMode.php index 4b57139..6190577 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" = "Drupal\entity\EntityFormModeListController", * "form" = { * "add" = "Drupal\entity\Form\EntityFormModeAddForm", diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php index 1a83bb4..eb90e4d 100644 --- a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php +++ b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php @@ -22,7 +22,7 @@ * id = "field_instance_config", * label = @Translation("Field instance"), * controllers = { - * "storage" = "Drupal\field\FieldConfigInstanceStorage" + * "storage" = "Drupal\field\FieldInstanceConfigStorage" * }, * config_prefix = "instance", * entity_keys = { @@ -392,7 +392,7 @@ public static function preDelete(EntityStorageInterface $storage, array $instanc /** * {@inheritdoc} */ - public static function postDelete(EntityStorageInterface $storage_controller, array $instances) { + 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(). diff --git a/core/modules/field/lib/Drupal/field/FieldConfigStorage.php b/core/modules/field/lib/Drupal/field/FieldConfigStorage.php index 5922c41..afe9f0d 100644 --- a/core/modules/field/lib/Drupal/field/FieldConfigStorage.php +++ b/core/modules/field/lib/Drupal/field/FieldConfigStorage.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\field\FieldConfigStorageController. + * Contains \Drupal\field\FieldConfigStorage. */ namespace Drupal\field; @@ -46,7 +46,7 @@ class FieldConfigStorage extends ConfigEntityStorage { protected $state; /** - * Constructs a FieldConfigStorageController object. + * Constructs a FieldConfigStorage object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -100,18 +100,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/FieldInstanceConfigStorage.php b/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorage.php index 72ec052..509d0ab 100644 --- a/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorage.php +++ b/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorage.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\field\FieldInstanceConfigStorageController. + * Contains \Drupal\field\FieldInstanceConfigStorage. */ namespace Drupal\field; @@ -44,7 +44,7 @@ class FieldInstanceConfigStorage extends ConfigEntityStorage { protected $state; /** - * Constructs a FieldInstanceConfigStorageController object. + * Constructs a FieldInstanceConfigStorage object. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. @@ -107,18 +107,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/menu/lib/Drupal/menu/Form/MenuDeleteForm.php b/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php index 7d4aeb4..4a0a965 100644 --- a/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php +++ b/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php @@ -22,7 +22,7 @@ class MenuDeleteForm extends EntityConfirmFormBase { * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The database connection. @@ -40,7 +40,7 @@ class MenuDeleteForm extends EntityConfirmFormBase { * The database connection. */ public function __construct(EntityStorageInterface $storage, Connection $connection) { - $this->storageController = $storage; + $this->storage = $storage; $this->connection = $connection; } @@ -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())) . '

'; } @@ -107,13 +107,13 @@ public function submit(array $form, array &$form_state) { // Reset all the menu links defined by the system via hook_menu_link_defaults(). // @todo Convert this to an EFQ. $result = $this->connection->query("SELECT mlid FROM {menu_links} WHERE menu_name = :menu AND module = 'system' ORDER BY depth ASC", array(':menu' => $this->entity->id()), array('fetch' => \PDO::FETCH_ASSOC))->fetchCol(); - $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_link/lib/Drupal/menu_link/MenuLinkStorage.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorage.php index d5c9466..128e13a 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorage.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorage.php @@ -39,7 +39,7 @@ public function create(array $values = array()) { } /** - * Overrides DatabaseStorageController::save(). + * {@inheritdoc} */ public function save(EntityInterface $entity) { 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 51a903a..d314834 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 @@ -25,7 +25,7 @@ class Entity extends DestinationBase implements ContainerFactoryPluginInterface * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * Constructs an entity destination plugin. @@ -41,7 +41,7 @@ class Entity extends DestinationBase implements ContainerFactoryPluginInterface */ public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->storageController = $storage; + $this->storage = $storage; } /** @@ -62,7 +62,7 @@ public static function create(ContainerInterface $container, array $configuratio public function import(Row $row) { // @TODO: add field handling. https://drupal.org/node/2164451 // @TODO: add validation https://drupal.org/node/2164457 - $entity = $this->storageController->create($row->getDestination()); + $entity = $this->storage->create($row->getDestination()); $entity->save(); return array($entity->id()); } diff --git a/core/modules/node/lib/Drupal/node/Form/DeleteMultiple.php b/core/modules/node/lib/Drupal/node/Form/DeleteMultiple.php index 1aa8442..dde11a6 100644 --- a/core/modules/node/lib/Drupal/node/Form/DeleteMultiple.php +++ b/core/modules/node/lib/Drupal/node/Form/DeleteMultiple.php @@ -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->getStorage('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/Tests/NodeTranslationUITest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php index 28cd4bd..b1a8b3f 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php @@ -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/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/Form/SetCustomize.php b/core/modules/shortcut/lib/Drupal/shortcut/Form/SetCustomize.php index ebac22b..08a1b19 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Form/SetCustomize.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Form/SetCustomize.php @@ -21,7 +21,7 @@ class SetCustomize extends EntityFormController { * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * Constructs a SetCustomize object. @@ -30,7 +30,7 @@ class SetCustomize extends EntityFormController { * The entity manager. */ public function __construct(EntityManagerInterface $entity_manager) { - $this->storageController = $entity_manager->getStorage('shortcut'); + $this->storage = $entity_manager->getStorage('shortcut'); } /** @@ -66,7 +66,7 @@ public function form(array $form, array &$form_state) { ), ); - $shortcuts = $this->storageController->loadByProperties(array('shortcut_set' => $this->entity->id())); + $shortcuts = $this->storage->loadByProperties(array('shortcut_set' => $this->entity->id())); foreach ($shortcuts as $shortcut) { $id = $shortcut->id(); $form['shortcuts']['links'][$id]['#attributes']['class'][] = 'draggable'; @@ -119,7 +119,7 @@ protected function actions(array $form, array &$form_state) { * {@inheritdoc} */ public function save(array $form, array &$form_state) { - $shortcuts = $this->storageController->loadByProperties(array('shortcut_set' => $this->entity->id())); + $shortcuts = $this->storage->loadByProperties(array('shortcut_set' => $this->entity->id())); foreach ($shortcuts as $shortcut) { $shortcut->setWeight($form_state['values']['shortcuts']['links'][$shortcut->id()]['weight']); $shortcut->save(); diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php index 0a52c1a..99314c8 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutSetDeleteForm.php @@ -29,14 +29,14 @@ class ShortcutSetDeleteForm extends EntityConfirmFormBase { * * @var \Drupal\shortcut\ShortcutSetStorageInterface */ - protected $storageController; + protected $storage; /** * Constructs a ShortcutSetDeleteForm object. */ public function __construct(Connection $database, ShortcutSetStorageInterface $storage) { $this->database = $database; - $this->storageController = $storage; + $this->storage = $storage; } /** @@ -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/system/lib/Drupal/system/Entity/Menu.php b/core/modules/system/lib/Drupal/system/Entity/Menu.php index 9f052b1..2d6a566 100644 --- a/core/modules/system/lib/Drupal/system/Entity/Menu.php +++ b/core/modules/system/lib/Drupal/system/Entity/Menu.php @@ -91,7 +91,7 @@ public function isLocked() { /** * {@inheritdoc} */ - public function postSave(EntityStorageControllerInterface $storage, $update = TRUE) { + public function postSave(EntityStorageInterface $storage, $update = TRUE) { parent::postSave($storage, $update); Cache::invalidateTags(array('menu' => $this->id())); @@ -100,8 +100,8 @@ public function postSave(EntityStorageControllerInterface $storage, $update = TR /** * {@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/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php index 15d5eaf..def8dba 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php @@ -228,7 +228,7 @@ protected function buildRow(array $modules, $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/Tests/Menu/LinksTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php index 52fa21b..1f8d34f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/LinksTest.php @@ -269,7 +269,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'); @@ -277,7 +277,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/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/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/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php index b75b92e..312585b 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php @@ -8,9 +8,8 @@ namespace Drupal\taxonomy\Entity; use Drupal\Core\Config\Entity\ConfigEntityBase; -use Drupal\Core\Entity\EntityStorageControllerInterface; -use Drupal\field\Field; use Drupal\Core\Entity\EntityStorageInterface; +use Drupal\field\Field; use Drupal\taxonomy\VocabularyInterface; /** @@ -123,7 +122,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { } } - $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; 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 8f2b944..0756ca5 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 @@ -26,7 +26,7 @@ class Uid extends Numeric { * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * Constructs a Drupal\Component\Plugin\PluginBase object. @@ -42,7 +42,7 @@ class Uid extends Numeric { */ public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->storageController = $storage; + $this->storage = $storage; } /** @@ -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/views/lib/Drupal/views/Controller/ViewAjaxController.php b/core/modules/views/lib/Drupal/views/Controller/ViewAjaxController.php index c05642b..ca9ae0e 100644 --- a/core/modules/views/lib/Drupal/views/Controller/ViewAjaxController.php +++ b/core/modules/views/lib/Drupal/views/Controller/ViewAjaxController.php @@ -29,7 +29,7 @@ class ViewAjaxController implements ContainerInjectionInterface { * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The factory to load a view executable with. @@ -47,7 +47,7 @@ class ViewAjaxController implements ContainerInjectionInterface { * The factory to load a view executable with. */ public function __construct(EntityStorageInterface $storage, ViewExecutableFactory $executable_factory) { - $this->storageController = $storage; + $this->storage = $storage; $this->executableFactory = $executable_factory; } @@ -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/Routing/ViewPageController.php b/core/modules/views/lib/Drupal/views/Routing/ViewPageController.php index fa421ac..af91c17 100644 --- a/core/modules/views/lib/Drupal/views/Routing/ViewPageController.php +++ b/core/modules/views/lib/Drupal/views/Routing/ViewPageController.php @@ -25,7 +25,7 @@ class ViewPageController implements ContainerInjectionInterface { * * @var \Drupal\Core\Entity\EntityStorageInterface */ - protected $storageController; + protected $storage; /** * The view executable factory. @@ -43,7 +43,7 @@ class ViewPageController implements ContainerInjectionInterface { * The view executable factory */ public function __construct(EntityStorageInterface $storage, ViewExecutableFactory $executable_factory) { - $this->storageController = $storage; + $this->storage = $storage; $this->executableFactory = $executable_factory; } @@ -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/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/QueryGroupByTest.php b/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php index 9d3c153..8e8920b 100644 --- a/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/QueryGroupByTest.php @@ -31,7 +31,7 @@ class QueryGroupByTest extends ViewUnitTestBase { * * @var \Drupal\Core\Entity\FieldableDatabaseEntityStorage */ - public $storageController; + public $storage; public static function getInfo() { return array( @@ -49,7 +49,7 @@ protected function setUp() { $this->installSchema('entity_test', array('entity_test')); - $this->storageController = $this->container->get('entity.manager')->getStorage('entity_test'); + $this->storage = $this->container->get('entity.manager')->getStorage('entity_test'); } @@ -109,17 +109,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(); } /** @@ -165,7 +165,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_get_view('test_group_by_in_filters'); 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 cf612ed..26626ee 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 @@ -52,7 +52,7 @@ class ViewsBlockTest extends UnitTestCase { * * @var \Drupal\Core\Entity\EntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $storageController; + protected $storage; /** * The mocked user account. @@ -101,11 +101,11 @@ protected function setUp() { ->with($this->view) ->will($this->returnValue($this->executable)); - $this->storageController = $this->getMockBuilder('Drupal\views\ViewStorage') + $this->storage = $this->getMockBuilder('Drupal\views\ViewStorage') ->disableOriginalConstructor() ->getMock(); - $this->storageController->expects($this->any()) + $this->storage->expects($this->any()) ->method('load') ->with('test_view') ->will($this->returnValue($this->view)); @@ -129,7 +129,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()); } @@ -150,7 +150,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/Routing/ViewPageControllerTest.php b/core/modules/views/tests/Drupal/views/Tests/Routing/ViewPageControllerTest.php index 682b0b2..151eb13 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Routing/ViewPageControllerTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Routing/ViewPageControllerTest.php @@ -35,7 +35,7 @@ class ViewPageControllerTest extends UnitTestCase { * * @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\views\ViewStorage') + $this->storage = $this->getMockBuilder('Drupal\views\ViewStorage') ->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));