1 | <?php |
||
18 | abstract class DisplayBase extends PluginBase implements DisplayInterface, ContainerFactoryPluginInterface { |
||
19 | |||
20 | use PluginConfigurationFormTrait; |
||
21 | |||
22 | /** |
||
23 | * Plugin label. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $label; |
||
28 | |||
29 | /** |
||
30 | * Selected entities. |
||
31 | * |
||
32 | * @var \Drupal\Core\Entity\EntityInterface[] |
||
33 | */ |
||
34 | protected $entities = []; |
||
35 | |||
36 | /** |
||
37 | * Event dispatcher service. |
||
38 | * |
||
39 | * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface |
||
40 | */ |
||
41 | protected $eventDispatcher; |
||
42 | |||
43 | /** |
||
44 | * UUID generator interface. |
||
45 | * |
||
46 | * @var \Drupal\Component\Uuid\UuidInterface |
||
47 | */ |
||
48 | protected $uuidGenerator; |
||
49 | |||
50 | /** |
||
51 | * Instance UUID string. |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $uuid = NULL; |
||
56 | |||
57 | /** |
||
58 | * The selection storage. |
||
59 | * |
||
60 | * @var \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface |
||
61 | */ |
||
62 | protected $selectionStorage; |
||
63 | |||
64 | /** |
||
65 | * Constructs display plugin. |
||
66 | * |
||
67 | * @param array $configuration |
||
68 | * A configuration array containing information about the plugin instance. |
||
69 | * @param string $plugin_id |
||
70 | * The plugin_id for the plugin instance. |
||
71 | * @param mixed $plugin_definition |
||
72 | * The plugin implementation definition. |
||
73 | * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher |
||
74 | * Event dispatcher service. |
||
75 | * @param \Drupal\Component\Uuid\UuidInterface $uuid_generator |
||
76 | * UUID generator interface. |
||
77 | * @param \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface $selection_storage |
||
78 | * The selection storage. |
||
79 | */ |
||
80 | public function __construct(array $configuration, $plugin_id, $plugin_definition, EventDispatcherInterface $event_dispatcher, UuidInterface $uuid_generator, KeyValueStoreExpirableInterface $selection_storage) { |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function defaultConfiguration() { |
||
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | public function getConfiguration() { |
||
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | public function setConfiguration(array $configuration) { |
||
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | public function calculateDependencies() { |
||
132 | |||
133 | /** |
||
134 | * {@inheritdoc} |
||
135 | */ |
||
136 | public function label() { |
||
139 | |||
140 | /** |
||
141 | * {@inheritdoc} |
||
142 | */ |
||
143 | public function getUuid() { |
||
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | public function setUuid($uuid) { |
||
156 | |||
157 | /** |
||
158 | * {@inheritdoc} |
||
159 | */ |
||
160 | public function displayEntityBrowser(array $element, FormStateInterface $form_state, array &$complete_form, array $persistent_data = []) { |
||
169 | |||
170 | /** |
||
171 | * {@inheritdoc} |
||
172 | */ |
||
173 | public function selectionCompleted(array $entities) { |
||
177 | |||
178 | } |
||
179 |