Issue #2078847 by andypost: Clean-up the rest of 'plugin.manager.entity' to 'entity.manager'.
parent
7b7f4fbdef
commit
455749e07a
|
@ -49,7 +49,7 @@ class ConfirmDeleteMultiple extends ConfirmFormBase implements ContainerInjectio
|
|||
*/
|
||||
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 @@ class ConfigurableEntityReferenceItem extends ConfigEntityReferenceItemBase impl
|
|||
);
|
||||
|
||||
// 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 @@ class FieldAttachOtherTest extends FieldUnitTestBase {
|
|||
$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 @@ class FieldAttachStorageTest extends FieldUnitTestBase {
|
|||
$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 @@ class FieldAttachStorageTest extends FieldUnitTestBase {
|
|||
}
|
||||
|
||||
// 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 @@ class FieldAttachStorageTest extends FieldUnitTestBase {
|
|||
$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 @@ class FieldAttachStorageTest extends FieldUnitTestBase {
|
|||
$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 @@ class FieldAttachStorageTest extends FieldUnitTestBase {
|
|||
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 @@ abstract class FieldUnitTestBase extends DrupalUnitTestBase {
|
|||
*/
|
||||
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 @@ abstract class DisplayOverviewBase extends OverviewBase {
|
|||
*/
|
||||
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 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
|
|||
*/
|
||||
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 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
|
|||
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 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
|
|||
|
||||
// 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 @@ class TermAutocompleteController implements ContainerInjectionInterface {
|
|||
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 @@ class TermFormController extends EntityFormControllerNG {
|
|||
*/
|
||||
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')
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue