Commit 7742cc35 authored by alexpott's avatar alexpott

Issue #2057869 by dawehner, jibran: Provide an alias for...

Issue #2057869 by dawehner, jibran: Provide an alias for 'plugin.manager.entity' called 'entity.manager'.
parent 5b41b6f8
......@@ -157,11 +157,11 @@ services:
arguments: [ '%container.namespaces%' ]
tags:
- { name: persist }
plugin.manager.entity:
entity.manager:
class: Drupal\Core\Entity\EntityManager
arguments: ['@container.namespaces', '@service_container', '@module_handler', '@cache.cache', '@language_manager', '@string_translation']
entity.manager:
alias: plugin.manager.entity
plugin.manager.entity:
alias: entity.manager
plugin.manager.entity.field.field_type:
class: Drupal\Core\Entity\Field\FieldTypePluginManager
arguments: ['@container.namespaces', '@cache.entity', '@language_manager', '@module_handler']
......@@ -265,7 +265,7 @@ services:
- [add, ['@legacy_router']]
entity.query:
class: Drupal\Core\Entity\Query\QueryFactory
arguments: ['@plugin.manager.entity']
arguments: ['@entity.manager']
calls:
- [setContainer, ['@service_container']]
entity.query.config:
......@@ -314,12 +314,12 @@ services:
class: Drupal\Core\ParamConverter\EntityConverter
tags:
- { name: paramconverter }
arguments: ['@plugin.manager.entity']
arguments: ['@entity.manager']
route_subscriber.entity:
class: Drupal\Core\EventSubscriber\EntityRouteAlterSubscriber
tags:
- { name: event_subscriber }
arguments: ['@plugin.manager.entity']
arguments: ['@entity.manager']
reverse_proxy_subscriber:
class: Drupal\Core\EventSubscriber\ReverseProxySubscriber
tags:
......@@ -406,7 +406,7 @@ services:
- { name: access_check }
access_check.entity_create:
class: Drupal\Core\Entity\EntityCreateAccessCheck
arguments: ['@plugin.manager.entity']
arguments: ['@entity.manager']
tags:
- { name: access_check }
maintenance_mode_subscriber:
......@@ -537,7 +537,7 @@ services:
arguments: ['@module_handler']
date:
class: Drupal\Core\Datetime\Date
arguments: ['@plugin.manager.entity', '@language_manager']
arguments: ['@entity.manager', '@language_manager']
feed.bridge.reader:
class: Drupal\Component\Bridge\ZfExtensionManagerSfContainer
calls:
......
......@@ -163,7 +163,7 @@ public static function currentUser() {
* The entity manager service.
*/
public static function entityManager() {
return static::$container->get('plugin.manager.entity');
return static::$container->get('entity.manager');
}
/**
......
......@@ -38,7 +38,7 @@ abstract class ControllerBase extends ContainerAware {
* The entity manager service.
*/
protected function entityManager() {
return $this->container->get('plugin.manager.entity');
return $this->container->get('entity.manager');
}
/**
......
......@@ -39,7 +39,7 @@ public function __construct(EntityManager $entity_manager) {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity')
$container->get('entity.manager')
);
}
......
......@@ -61,7 +61,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ
return new static(
$entity_type,
$entity_info,
$container->get('plugin.manager.entity')->getStorageController($entity_type),
$container->get('entity.manager')->getStorageController($entity_type),
$container->get('module_handler')
);
}
......
......@@ -46,7 +46,7 @@ public function content(Request $request, $_entity_form) {
* @endcode
*/
protected function getFormObject(Request $request, $form_arg) {
$manager = $this->container->get('plugin.manager.entity');
$manager = $this->container->get('entity.manager');
// If no operation is provided, use 'default'.
$form_arg .= '.default';
......
......@@ -56,7 +56,7 @@ public function __construct($base_plugin_id, EntityManager $entity_manager) {
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static(
$base_plugin_id,
$container->get('plugin.manager.entity')
$container->get('entity.manager')
);
}
......
......@@ -43,7 +43,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity')->getStorageController('action'),
$container->get('entity.manager')->getStorageController('action'),
$container->get('plugin.manager.action')
);
}
......
......@@ -46,7 +46,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity')->getStorageController('action')
$container->get('entity.manager')->getStorageController('action')
);
}
......
......@@ -61,7 +61,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ
return new static(
$entity_type,
$entity_info,
$container->get('plugin.manager.entity')->getStorageController($entity_type),
$container->get('entity.manager')->getStorageController($entity_type),
$container->get('plugin.manager.action'),
$container->get('module_handler')
);
......
......@@ -67,7 +67,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('token'),
$container->get('plugin.manager.entity')
$container->get('entity.manager')
);
}
......
......@@ -86,7 +86,7 @@ public function __construct(EntityManager $entity_manager, Connection $database,
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('database'),
$container->get('config.factory'),
$container->get('module_handler'),
......
......@@ -70,7 +70,7 @@ public function __construct(ModuleHandlerInterface $module_handler, EntityManage
public static function create(ContainerInterface $container) {
return new static (
$container->get('module_handler'),
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('aggregator.category.storage')
);
}
......
......@@ -76,7 +76,7 @@ public static function create(ContainerInterface $container) {
return new static(
$container->get('database'),
$container->get('entity.query'),
$container->get('plugin.manager.entity')->getStorageController('aggregator_feed'),
$container->get('entity.manager')->getStorageController('aggregator_feed'),
$container->get('http_default_client')
);
}
......
......@@ -50,7 +50,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('plugin.manager.entity'));
return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity.manager'));
}
/**
......
......@@ -50,7 +50,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('plugin.manager.entity'));
return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity.manager'));
}
/**
......
......@@ -58,8 +58,8 @@ protected function setUp() {
ViewTestData::importTestViews(get_class($this), array('aggregator_test_views'));
$this->itemStorageController = $this->container->get('plugin.manager.entity')->getStorageController('aggregator_item');
$this->feedStorageController = $this->container->get('plugin.manager.entity')->getStorageController('aggregator_feed');
$this->itemStorageController = $this->container->get('entity.manager')->getStorageController('aggregator_item');
$this->feedStorageController = $this->container->get('entity.manager')->getStorageController('aggregator_feed');
}
/**
......
......@@ -41,7 +41,7 @@ class CustomBlockController implements ContainerInjectionInterface {
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
$entity_manager = $container->get('plugin.manager.entity');
$entity_manager = $container->get('entity.manager');
return new static(
$entity_manager,
$entity_manager->getStorageController('custom_block'),
......
......@@ -83,7 +83,7 @@ public function testListing() {
// Edit the entity using the operations link.
$blocks = $this->container
->get('plugin.manager.entity')
->get('entity.manager')
->getStorageController('custom_block')
->loadByProperties(array('info' => $label));
$block = reset($blocks);
......
......@@ -151,7 +151,7 @@ public function testsCustomBlockAddTypes() {
// Get the custom block storage controller.
$storage_controller = $this->container
->get('plugin.manager.entity')
->get('entity.manager')
->getStorageController('custom_block');
// Test that adding a block from the 'place blocks' form sends you to the
......
......@@ -69,7 +69,7 @@ public function __construct(EntityManager $entity_manager, QueryFactory $entity_
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('entity.query'),
$container->get('language_manager')
);
......
......@@ -70,7 +70,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ
return new static(
$entity_type,
$entity_info,
$container->get('plugin.manager.entity')->getStorageController($entity_type),
$container->get('entity.manager')->getStorageController($entity_type),
$container->get('module_handler'),
$container->get('plugin.manager.block')
);
......
......@@ -72,7 +72,7 @@ function testBlockRenderOrder() {
$this->drupalGet('');
$test_content = $this->drupalGetContent('');
$controller = $this->container->get('plugin.manager.entity')->getStorageController('block');
$controller = $this->container->get('entity.manager')->getStorageController('block');
foreach ($controller->loadMultiple() as $return_block) {
$settings = $return_block->get('settings');
$id = $return_block->get('id');
......
......@@ -48,7 +48,7 @@ public static function getInfo() {
protected function setUp() {
parent::setUp();
$this->controller = $this->container->get('plugin.manager.entity')->getStorageController('block');
$this->controller = $this->container->get('entity.manager')->getStorageController('block');
}
/**
......
......@@ -66,7 +66,7 @@ protected function testDeleteBlockDisplay() {
$this->assertBlockAppears($block_3);
$this->assertBlockAppears($block_4);
$block_storage_controller = $this->container->get('plugin.manager.entity')->getStorageController('block');
$block_storage_controller = $this->container->get('entity.manager')->getStorageController('block');
// Remove the block display, so both block entities from the first view
// should both dissapear.
......@@ -113,7 +113,7 @@ public function testViewsBlockForm() {
$this->assertNoFieldById('edit-machine-name', 'stark.views_block__test_view_block_1', 'The machine name is hidden on the views block form.');
// Save the block.
$this->drupalPost(NULL, array(), t('Save block'));
$storage = $this->container->get('plugin.manager.entity')->getStorageController('block');
$storage = $this->container->get('entity.manager')->getStorageController('block');
$block = $storage->load('stark.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.
......
services:
book.manager:
class: Drupal\book\BookManager
arguments: ['@database', '@plugin.manager.entity']
arguments: ['@database', '@entity.manager']
......@@ -188,7 +188,7 @@ function _breakpoint_import_breakpoint_groups($source, $source_type) {
*/
function _breakpoint_delete_breakpoints($list, $source_type) {
$ids = config_get_storage_names_with_prefix('breakpoint.breakpoint_group.' . $source_type . '.');
$entity_info = Drupal::service('plugin.manager.entity')->getDefinition('breakpoint_group');
$entity_info = Drupal::service('entity.manager')->getDefinition('breakpoint_group');
// Remove the breakpoint.breakpoint part of the breakpoint identifier.
foreach ($ids as &$id) {
......@@ -203,7 +203,7 @@ function _breakpoint_delete_breakpoints($list, $source_type) {
// Get all breakpoints defined by this theme/module.
$breakpoint_ids = Drupal::service('config.storage')->listAll('breakpoint.breakpoint.' . $source_type . '.' . $breakpoint_group->id() . '.');
$entity_info = Drupal::service('plugin.manager.entity')->getDefinition('breakpoint');
$entity_info = Drupal::service('entity.manager')->getDefinition('breakpoint');
// Remove the breakpoint.breakpoint part of the breakpoint identifier.
foreach ($breakpoint_ids as &$breakpoint_id) {
......
......@@ -39,7 +39,7 @@ function setUp() {
user_install_picture_field();
// Add the basic_html filter format from the standard install profile.
$filter_format_storage_controller = $this->container->get('plugin.manager.entity')->getStorageController('filter_format');
$filter_format_storage_controller = $this->container->get('entity.manager')->getStorageController('filter_format');
$filter_format = $filter_format_storage_controller->create(array(
'format' => 'basic_html',
'name' => 'Basic HTML',
......
......@@ -107,7 +107,7 @@ public static function create(ContainerInterface $container) {
$container->get('lock'),
$container->get('event_dispatcher'),
$container->get('config.factory'),
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('url_generator')
);
}
......
......@@ -35,7 +35,7 @@ public static function getInfo() {
* Tests entity list controller methods.
*/
function testList() {
$controller = $this->container->get('plugin.manager.entity')
$controller = $this->container->get('entity.manager')
->getListController('config_test');
// Test getStorageController() method.
......@@ -123,7 +123,7 @@ function testList() {
// Test that config entities that do not support status, do not have
// enable/disable operations.
$controller = $this->container->get('plugin.manager.entity')
$controller = $this->container->get('entity.manager')
->getListController('config_test_no_status');
$list = $controller->load();
......
......@@ -33,7 +33,7 @@ public static function getInfo() {
* Tests storage controller methods.
*/
public function testStorageControllerMethods() {
$controller = $this->container->get('plugin.manager.entity')->getStorageController('config_test');
$controller = $this->container->get('entity.manager')->getStorageController('config_test');
$info = entity_get_info('config_test');
$expected = $info['config_prefix'] . '.';
......
......@@ -59,7 +59,7 @@ function setUp() {
$config_comparer->createChangelist(),
$this->container->get('event_dispatcher'),
$this->container->get('config.factory'),
$this->container->get('plugin.manager.entity'),
$this->container->get('entity.manager'),
$this->container->get('lock')
);
$this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.staging'));
......
......@@ -40,7 +40,7 @@ protected function setUp() {
* Test some of the methods.
*/
public function testMessageMethods() {
$message_storage = $this->container->get('plugin.manager.entity')->getStorageController('contact_message');
$message_storage = $this->container->get('entity.manager')->getStorageController('contact_message');
$message = $message_storage->create(array('category' => 'feedback'));
// Check for empty values first.
......
services:
content_translation.synchronizer:
class: Drupal\content_translation\FieldTranslationSynchronizer
arguments: ['@plugin.manager.entity']
arguments: ['@entity.manager']
......@@ -71,7 +71,7 @@ public static function getInfo() {
protected function setUp() {
parent::setUp();
$this->synchronizer = new FieldTranslationSynchronizer($this->container->get('plugin.manager.entity'));
$this->synchronizer = new FieldTranslationSynchronizer($this->container->get('entity.manager'));
$this->synchronized = array('sync1', 'sync2');
$this->columns = array_merge($this->synchronized, array('var1', 'var2'));
$this->langcodes = array('en', 'it', 'fr', 'de', 'es');
......
......@@ -203,7 +203,7 @@ protected function createEntity($values, $langcode, $bundle_name = NULL) {
if (!empty($info['entity_keys']['bundle'])) {
$entity_values[$info['entity_keys']['bundle']] = $bundle_name ?: $this->bundle;
}
$controller = $this->container->get('plugin.manager.entity')->getStorageController($this->entityType);
$controller = $this->container->get('entity.manager')->getStorageController($this->entityType);
if (!($controller instanceof DatabaseStorageControllerNG)) {
foreach ($values as $property => $value) {
if (is_array($value)) {
......
......@@ -88,7 +88,7 @@ public static function create(ContainerInterface $container, array $configuratio
$configuration['label'],
$configuration['view_mode'],
$container->get('date'),
$container->get('plugin.manager.entity')->getStorageController('date_format')
$container->get('entity.manager')->getStorageController('date_format')
);
}
......
......@@ -56,7 +56,7 @@ public static function create(ContainerInterface $container) {
$container->get('database'),
$container->get('module_handler'),
$container->get('date'),
$container->get('plugin.manager.entity')->getStorageController('user')
$container->get('entity.manager')->getStorageController('user')
);
}
......
......@@ -95,7 +95,7 @@ public static function create(ContainerInterface $container) {
$container->get('user.tempstore'),
$container->get('edit.metadata.generator'),
$container->get('edit.editor.selector'),
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('field.info')
);
}
......
......@@ -38,7 +38,7 @@ public function __construct(PluginManagerInterface $entity_manager) {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity')
$container->get('entity.manager')
);
}
......
......@@ -49,7 +49,7 @@ public function __construct($entity_type, array $entity_info, EntityStorageContr
* {@inheritdoc}
*/
public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
$entity_manager = $container->get('plugin.manager.entity');
$entity_manager = $container->get('entity.manager');
return new static(
$entity_type,
$entity_info,
......
......@@ -57,7 +57,7 @@ public function __construct(QueryFactory $query_factory, EntityManager $entity_m
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.query'),
$container->get('plugin.manager.entity')
$container->get('entity.manager')
);
}
......
......@@ -4,4 +4,4 @@ services:
arguments: ['@container.namespaces', '@cache.cache', '@language_manager', '@module_handler']
entity_reference.autocomplete:
class: Drupal\entity_reference\EntityReferenceAutocomplete
arguments: ['@plugin.manager.entity', '@plugin.manager.entity_reference.selection']
arguments: ['@entity.manager', '@plugin.manager.entity_reference.selection']
......@@ -83,7 +83,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ
$container->get('config.factory'),
$container->get('config.storage'),
$container->get('entity.query'),
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('module_handler'),
$container->get('state')
);
......
......@@ -79,7 +79,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ
$container->get('config.factory'),
$container->get('config.storage'),
$container->get('entity.query'),
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('module_handler'),
$container->get('state')
);
......
......@@ -153,7 +153,7 @@ function testFieldFormSingle() {
);
$this->drupalPost(NULL, $edit, t('Save'));
$this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated');
$this->container->get('plugin.manager.entity')->getStorageController('entity_test')->resetCache(array($id));
$this->container->get('entity.manager')->getStorageController('entity_test')->resetCache(array($id));
$entity = entity_load('entity_test', $id);
$this->assertEqual($entity->{$field_name}->value, $value, 'Field value was updated');
......@@ -166,7 +166,7 @@ function testFieldFormSingle() {
);
$this->drupalPost('entity_test/manage/' . $id . '/edit', $edit, t('Save'));
$this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated');
$this->container->get('plugin.manager.entity')->getStorageController('entity_test')->resetCache(array($id));
$this->container->get('entity.manager')->getStorageController('entity_test')->resetCache(array($id));
$entity = entity_load('entity_test', $id);
$this->assertTrue($entity->{$field_name}->isEmpty(), 'Field was emptied');
}
......@@ -577,7 +577,7 @@ function testFieldFormAccess() {
$this->drupalPost($entity_type . '/manage/' . $id . '/edit', $edit, t('Save'));
// Check that the new revision has the expected values.
$this->container->get('plugin.manager.entity')->getStorageController($entity_type)->resetCache(array($id));
$this->container->get('entity.manager')->getStorageController($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.');
......
services:
field_ui.subscriber:
class: Drupal\field_ui\Routing\RouteSubscriber
arguments: ['@plugin.manager.entity']
arguments: ['@entity.manager']
tags:
- { name: event_subscriber }
access_check.field_ui.view_mode:
......
......@@ -22,7 +22,7 @@ class DisplayOverview extends DisplayOverviewBase {
*/
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.formatter')
);
......
......@@ -79,7 +79,7 @@ public static function createInstance(ContainerInterface $container, $entity_typ
return new static(
$entity_type,
$entity_info,
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('module_handler'),
$container->get('plugin.manager.entity.field.field_type')
);
......
......@@ -54,7 +54,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('module_handler')
);
......
......@@ -38,7 +38,7 @@ public function __construct(EntityManager $entity_manager) {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity')
$container->get('entity.manager')
);
}
......
......@@ -78,7 +78,7 @@ public function __construct(EntityManager $entity_manager, FieldInfo $field_info
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity'),
$container->get('entity.manager'),
$container->get('field.info'),
$container->get('typed_data')
);
......
......@@ -49,7 +49,7 @@ public function __construct(EntityManager $entity_manager) {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity')
$container->get('entity.manager')
);
}
......
......@@ -22,7 +22,7 @@ class FormDisplayOverview extends DisplayOverviewBase {
*/
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')
);
......
......@@ -66,7 +66,7 @@ public function __construct(EntityManager $entity_manager) {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('plugin.manager.entity')
$container->get('entity.manager')
);
}
......
......@@ -212,7 +212,7 @@ function assertFileExists($file, $message = NULL) {
* Asserts that a file exists in the database.
*/
function assertFileEntryExists($file, $message = NULL) {
$this->container->get('plugin.manager.entity')->getStorageController('file')->resetCache();