Mercurial > hg > cmmr2012-drupal-site
diff core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
line wrap: on
line diff
--- a/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php Thu Feb 28 13:11:55 2019 +0000 +++ b/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php Thu May 09 15:34:47 2019 +0100 @@ -5,7 +5,10 @@ use Drupal\Core\Database\Connection; use Drupal\Core\Database\Query\Condition; use Drupal\Core\Database\Query\SelectInterface; -use Drupal\Core\Entity\EntityManagerInterface; +use Drupal\Core\Entity\EntityFieldManagerInterface; +use Drupal\Core\Entity\EntityRepositoryInterface; +use Drupal\Core\Entity\EntityTypeBundleInfoInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormStateInterface; @@ -34,13 +37,6 @@ protected $connection; /** - * The user storage. - * - * @var \Drupal\user\UserStorageInterface - */ - protected $userStorage; - - /** * Constructs a new UserSelection object. * * @param array $configuration @@ -49,20 +45,25 @@ * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager - * The entity manager service. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * The entity type manager service. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler service. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. * @param \Drupal\Core\Database\Connection $connection * The database connection. + * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager + * The entity field manager. + * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info + * The entity type bundle info service. + * @param \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository + * The entity repository. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, Connection $connection) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_manager, $module_handler, $current_user); + public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, Connection $connection, EntityFieldManagerInterface $entity_field_manager = NULL, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, EntityRepositoryInterface $entity_repository = NULL) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $module_handler, $current_user, $entity_field_manager, $entity_type_bundle_info, $entity_repository); $this->connection = $connection; - $this->userStorage = $entity_manager->getStorage('user'); } /** @@ -76,7 +77,10 @@ $container->get('entity.manager'), $container->get('module_handler'), $container->get('current_user'), - $container->get('database') + $container->get('database'), + $container->get('entity_field.manager'), + $container->get('entity_type.bundle.info'), + $container->get('entity.repository') ); }