Commit 455749e0 authored by webchick's avatar webchick

Issue #2078847 by andypost: Clean-up the rest of 'plugin.manager.entity' to 'entity.manager'.

parent 7b7f4fbd
......@@ -49,7 +49,7 @@ public function __construct(CommentStorageControllerInterface $comment_storage)
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity')->getStorageController('comment')
$container->get('entity.manager')->getStorageController('comment')
);
}
......
......@@ -4,12 +4,12 @@ services:
arguments: ['@container.namespaces']
access_check.edit.entity_field:
class: Drupal\edit\Access\EditEntityFieldAccessCheck
arguments: ['@plugin.manager.entity', '@field.info']
arguments: ['@entity.manager', '@field.info']
tags:
- { name: access_check }
access_check.edit.entity:
class: Drupal\edit\Access\EditEntityAccessCheck
arguments: ['@plugin.manager.entity']
arguments: ['@entity.manager']
tags:
- { name: access_check }
edit.editor.selector:
......
......@@ -67,7 +67,7 @@ public static function schema(FieldInterface $field) {
);
// Create a foreign key to the target entity type base type.
$entity_manager = \Drupal::service('plugin.manager.entity');
$entity_manager = \Drupal::service('entity.manager');
if (is_subclass_of($entity_manager->getControllerClass($field['settings']['target_type'], 'storage'), 'Drupal\Core\Entity\DatabaseStorageController')) {
$entity_info = $entity_manager->getDefinition($field['settings']['target_type']);
......
......@@ -275,7 +275,7 @@ function testFieldAttachCache() {
$this->assertFalse(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('plugin.manager.entity')->getStorageController($entity->entityType());
$controller = $this->container->get('entity.manager')->getStorageController($entity->entityType());
$controller->resetCache();
$controller->load($entity->id());
$cache = cache('field')->get($cid);
......
......@@ -74,7 +74,7 @@ function testFieldAttachSaveLoad() {
$values[$current_revision] = $current_values;
}
$storage_controller = $this->container->get('plugin.manager.entity')->getStorageController($entity_type);
$storage_controller = $this->container->get('entity.manager')->getStorageController($entity_type);
$storage_controller->resetCache();
$entity = $storage_controller->load($entity_id);
// Confirm current revision loads the correct data.
......@@ -160,7 +160,7 @@ function testFieldAttachLoadMultiple() {
}
// Check that a single load correctly loads field values for both entities.
$controller = $this->container->get('plugin.manager.entity')->getStorageController($entity->entityType());
$controller = $this->container->get('entity.manager')->getStorageController($entity->entityType());
$controller->resetCache();
$entities = $controller->loadMultiple();
foreach ($entities as $index => $entity) {
......@@ -270,7 +270,7 @@ function testFieldAttachDelete() {
$entity->setNewRevision();
$entity->save();
$vids[] = $entity->getRevisionId();
$controller = $this->container->get('plugin.manager.entity')->getStorageController($entity->entityType());
$controller = $this->container->get('entity.manager')->getStorageController($entity->entityType());
$controller->resetCache();
// Confirm each revision loads
......@@ -336,7 +336,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('plugin.manager.entity')->getStorageController($entity->entityType());
$controller = $this->container->get('entity.manager')->getStorageController($entity->entityType());
$controller->resetCache();
$entity = $controller->load($entity->id());
$this->assertEqual(count($entity->{$this->field_name}), $this->field['cardinality'], "Bundle name has been updated in the field storage");
......@@ -391,7 +391,7 @@ function testEntityDeleteBundle() {
entity_test_delete_bundle($this->instance['bundle'], $entity_type);
// Verify no data gets loaded
$controller = $this->container->get('plugin.manager.entity')->getStorageController($entity->entityType());
$controller = $this->container->get('entity.manager')->getStorageController($entity->entityType());
$controller->resetCache();
$entity= $controller->load($entity->id());
......
......@@ -107,7 +107,7 @@ function createFieldWithInstance($suffix = '', $entity_type = 'entity_test', $bu
*/
protected function entitySaveReload(EntityInterface $entity) {
$entity->save();
$controller = $this->container->get('plugin.manager.entity')->getStorageController($entity->entityType());
$controller = $this->container->get('entity.manager')->getStorageController($entity->entityType());
$controller->resetCache();
return $controller->load($entity->id());
}
......
......@@ -56,7 +56,7 @@ public function __construct(EntityManager $entity_manager, FieldTypePluginManage
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('plugin.manager.entity.field.field_type'),
$container->get('plugin.manager.field.widget')
);
......
......@@ -94,7 +94,7 @@ function setUp() {
*/
function testFieldLoad() {
$entity_type = $bundle = 'entity_test_rev';
$storage_controller = $this->container->get('plugin.manager.entity')->getStorageController($entity_type);
$storage_controller = $this->container->get('entity.manager')->getStorageController($entity_type);
$columns = array('bundle', 'deleted', 'entity_id', 'revision_id', 'delta', 'langcode', DatabaseStorageController::_fieldColumnName($this->field, 'value'));
......@@ -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('plugin.manager.entity')->getStorageController($entity_type);
$storage_controller = $this->container->get('entity.manager')->getStorageController($entity_type);
// Create two fields with instances, and generate randome values.
$name_base = drupal_strtolower($this->randomName(Field::NAME_MAX_LENGTH - 1));
......@@ -411,7 +411,7 @@ function testFieldUpdateIndexesWithData() {
// Verify that the tables were not dropped in the process.
field_cache_clear();
$entity = $this->container->get('plugin.manager.entity')->getStorageController($entity_type)->load(1);
$entity = $this->container->get('entity.manager')->getStorageController($entity_type)->load(1);
$this->assertEqual($entity->$field_name->value, 'field data', t("Index changes performed without dropping the tables"));
}
......
......@@ -68,7 +68,7 @@ public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.query')->get('taxonomy_term'),
$container->get('field.info'),
$container->get('plugin.manager.entity')->getStorageController('taxonomy_term')
$container->get('entity.manager')->getStorageController('taxonomy_term')
);
}
......
......@@ -50,7 +50,7 @@ public function __construct(VocabularyStorageControllerInterface $vocab_storage,
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity')->getStorageController('taxonomy_vocabulary'),
$container->get('entity.manager')->getStorageController('taxonomy_vocabulary'),
$container->get('config.factory')
);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment