Mercurial > hg > cmmr2012-drupal-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
3 namespace Drupal\user\Plugin\EntityReferenceSelection; | 3 namespace Drupal\user\Plugin\EntityReferenceSelection; |
4 | 4 |
5 use Drupal\Core\Database\Connection; | 5 use Drupal\Core\Database\Connection; |
6 use Drupal\Core\Database\Query\Condition; | 6 use Drupal\Core\Database\Query\Condition; |
7 use Drupal\Core\Database\Query\SelectInterface; | 7 use Drupal\Core\Database\Query\SelectInterface; |
8 use Drupal\Core\Entity\EntityManagerInterface; | 8 use Drupal\Core\Entity\EntityFieldManagerInterface; |
9 use Drupal\Core\Entity\EntityRepositoryInterface; | |
10 use Drupal\Core\Entity\EntityTypeBundleInfoInterface; | |
11 use Drupal\Core\Entity\EntityTypeManagerInterface; | |
9 use Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection; | 12 use Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection; |
10 use Drupal\Core\Extension\ModuleHandlerInterface; | 13 use Drupal\Core\Extension\ModuleHandlerInterface; |
11 use Drupal\Core\Form\FormStateInterface; | 14 use Drupal\Core\Form\FormStateInterface; |
12 use Drupal\Core\Session\AccountInterface; | 15 use Drupal\Core\Session\AccountInterface; |
13 use Drupal\user\RoleInterface; | 16 use Drupal\user\RoleInterface; |
32 * @var \Drupal\Core\Database\Connection | 35 * @var \Drupal\Core\Database\Connection |
33 */ | 36 */ |
34 protected $connection; | 37 protected $connection; |
35 | 38 |
36 /** | 39 /** |
37 * The user storage. | |
38 * | |
39 * @var \Drupal\user\UserStorageInterface | |
40 */ | |
41 protected $userStorage; | |
42 | |
43 /** | |
44 * Constructs a new UserSelection object. | 40 * Constructs a new UserSelection object. |
45 * | 41 * |
46 * @param array $configuration | 42 * @param array $configuration |
47 * A configuration array containing information about the plugin instance. | 43 * A configuration array containing information about the plugin instance. |
48 * @param string $plugin_id | 44 * @param string $plugin_id |
49 * The plugin_id for the plugin instance. | 45 * The plugin_id for the plugin instance. |
50 * @param mixed $plugin_definition | 46 * @param mixed $plugin_definition |
51 * The plugin implementation definition. | 47 * The plugin implementation definition. |
52 * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager | 48 * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager |
53 * The entity manager service. | 49 * The entity type manager service. |
54 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler | 50 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler |
55 * The module handler service. | 51 * The module handler service. |
56 * @param \Drupal\Core\Session\AccountInterface $current_user | 52 * @param \Drupal\Core\Session\AccountInterface $current_user |
57 * The current user. | 53 * The current user. |
58 * @param \Drupal\Core\Database\Connection $connection | 54 * @param \Drupal\Core\Database\Connection $connection |
59 * The database connection. | 55 * The database connection. |
60 */ | 56 * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager |
61 public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user, Connection $connection) { | 57 * The entity field manager. |
62 parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_manager, $module_handler, $current_user); | 58 * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info |
59 * The entity type bundle info service. | |
60 * @param \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository | |
61 * The entity repository. | |
62 */ | |
63 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) { | |
64 parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $module_handler, $current_user, $entity_field_manager, $entity_type_bundle_info, $entity_repository); | |
63 | 65 |
64 $this->connection = $connection; | 66 $this->connection = $connection; |
65 $this->userStorage = $entity_manager->getStorage('user'); | |
66 } | 67 } |
67 | 68 |
68 /** | 69 /** |
69 * {@inheritdoc} | 70 * {@inheritdoc} |
70 */ | 71 */ |
74 $plugin_id, | 75 $plugin_id, |
75 $plugin_definition, | 76 $plugin_definition, |
76 $container->get('entity.manager'), | 77 $container->get('entity.manager'), |
77 $container->get('module_handler'), | 78 $container->get('module_handler'), |
78 $container->get('current_user'), | 79 $container->get('current_user'), |
79 $container->get('database') | 80 $container->get('database'), |
81 $container->get('entity_field.manager'), | |
82 $container->get('entity_type.bundle.info'), | |
83 $container->get('entity.repository') | |
80 ); | 84 ); |
81 } | 85 } |
82 | 86 |
83 /** | 87 /** |
84 * {@inheritdoc} | 88 * {@inheritdoc} |