comparison core/lib/Drupal/Core/Entity/EntityManager.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children c2387f117808
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 use Drupal\Core\Field\FieldDefinitionInterface;
6 use Drupal\Core\Field\FieldStorageDefinitionInterface;
7 use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8 use Symfony\Component\DependencyInjection\ContainerAwareTrait;
9
10 /**
11 * Provides a wrapper around many other services relating to entities.
12 *
13 * Deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. We cannot
14 * use the deprecated PHPDoc tag because this service class is still used in
15 * legacy code paths. Symfony would fail test cases with deprecation warnings.
16 *
17 * @todo Enforce the deprecation of each method once
18 * https://www.drupal.org/node/2578361 is in.
19 */
20 class EntityManager implements EntityManagerInterface, ContainerAwareInterface {
21
22 use ContainerAwareTrait;
23
24 /**
25 * {@inheritdoc}
26 *
27 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
28 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::clearCachedDefinitions()
29 * instead.
30 *
31 * @see https://www.drupal.org/node/2549139
32 */
33 public function clearCachedDefinitions() {
34 $this->container->get('entity_type.manager')->clearCachedDefinitions();
35
36 // @todo None of these are plugin managers, and they should not co-opt
37 // this method for managing its caches. Remove in
38 // https://www.drupal.org/node/2549143.
39 $this->container->get('entity_type.bundle.info')->clearCachedBundles();
40 $this->container->get('entity_field.manager')->clearCachedFieldDefinitions();
41 $this->container->get('entity_type.repository')->clearCachedDefinitions();
42 }
43
44 /**
45 * {@inheritdoc}
46 *
47 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
48 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getDefinition()
49 * instead.
50 *
51 * @see https://www.drupal.org/node/2549139
52 */
53 public function getDefinition($entity_type_id, $exception_on_invalid = TRUE) {
54 return $this->container->get('entity_type.manager')->getDefinition($entity_type_id, $exception_on_invalid);
55 }
56
57 /**
58 * {@inheritdoc}
59 *
60 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
61 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::hasHandler()
62 * instead.
63 *
64 * @see https://www.drupal.org/node/2549139
65 */
66 public function hasHandler($entity_type, $handler_type) {
67 return $this->container->get('entity_type.manager')->hasHandler($entity_type, $handler_type);
68 }
69
70 /**
71 * {@inheritdoc}
72 *
73 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
74 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() instead.
75 *
76 * @see https://www.drupal.org/node/2549139
77 */
78 public function getStorage($entity_type) {
79 return $this->container->get('entity_type.manager')->getStorage($entity_type);
80 }
81
82 /**
83 * {@inheritdoc}
84 *
85 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
86 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getListBuilder()
87 * instead.
88 *
89 * @see https://www.drupal.org/node/2549139
90 */
91 public function getListBuilder($entity_type) {
92 return $this->container->get('entity_type.manager')->getListBuilder($entity_type);
93 }
94
95 /**
96 * {@inheritdoc}
97 *
98 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
99 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getFormObject()
100 * instead.
101 *
102 * @see https://www.drupal.org/node/2549139
103 */
104 public function getFormObject($entity_type, $operation) {
105 return $this->container->get('entity_type.manager')->getFormObject($entity_type, $operation);
106 }
107
108 /**
109 * {@inheritdoc}
110 *
111 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
112 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getRouteProviders()
113 * instead.
114 *
115 * @see https://www.drupal.org/node/2549139
116 */
117 public function getRouteProviders($entity_type) {
118 return $this->container->get('entity_type.manager')->getRouteProviders($entity_type);
119 }
120
121 /**
122 * {@inheritdoc}
123 *
124 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
125 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getViewBuilder()
126 * instead.
127 *
128 * @see https://www.drupal.org/node/2549139
129 */
130 public function getViewBuilder($entity_type) {
131 return $this->container->get('entity_type.manager')->getViewBuilder($entity_type);
132 }
133
134 /**
135 * {@inheritdoc}
136 *
137 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
138 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getAccessControlHandler()
139 * instead.
140 *
141 * @see https://www.drupal.org/node/2549139
142 */
143 public function getAccessControlHandler($entity_type) {
144 return $this->container->get('entity_type.manager')->getAccessControlHandler($entity_type);
145 }
146
147 /**
148 * {@inheritdoc}
149 *
150 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
151 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getHandler() instead.
152 *
153 * @see https://www.drupal.org/node/2549139
154 */
155 public function getHandler($entity_type, $handler_type) {
156 return $this->container->get('entity_type.manager')->getHandler($entity_type, $handler_type);
157 }
158
159 /**
160 * {@inheritdoc}
161 *
162 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
163 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::createHandlerInstance()
164 * instead.
165 *
166 * @see https://www.drupal.org/node/2549139
167 */
168 public function createHandlerInstance($class, EntityTypeInterface $definition = NULL) {
169 return $this->container->get('entity_type.manager')->createHandlerInstance($class, $definition);
170 }
171
172 /**
173 * {@inheritdoc}
174 *
175 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
176 * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getBaseFieldDefinitions()
177 * instead.
178 *
179 * @see https://www.drupal.org/node/2549139
180 */
181 public function getBaseFieldDefinitions($entity_type_id) {
182 return $this->container->get('entity_field.manager')->getBaseFieldDefinitions($entity_type_id);
183 }
184
185 /**
186 * {@inheritdoc}
187 *
188 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
189 * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldDefinitions()
190 * instead.
191 *
192 * @see https://www.drupal.org/node/2549139
193 */
194 public function getFieldDefinitions($entity_type_id, $bundle) {
195 return $this->container->get('entity_field.manager')->getFieldDefinitions($entity_type_id, $bundle);
196 }
197
198 /**
199 * {@inheritdoc}
200 *
201 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
202 * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldStorageDefinitions()
203 * instead.
204 *
205 * @see https://www.drupal.org/node/2549139
206 */
207 public function getFieldStorageDefinitions($entity_type_id) {
208 return $this->container->get('entity_field.manager')->getFieldStorageDefinitions($entity_type_id);
209 }
210
211 /**
212 * {@inheritdoc}
213 *
214 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
215 * Use \Drupal\Core\Entity\EntityFieldManagerInterface::setFieldMap()
216 * instead.
217 *
218 * @see https://www.drupal.org/node/2549139
219 */
220 public function setFieldMap(array $field_map) {
221 return $this->container->get('entity_field.manager')->setFieldMap($field_map);
222 }
223
224 /**
225 * {@inheritdoc}
226 *
227 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
228 * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldMap()
229 * instead.
230 *
231 * @see https://www.drupal.org/node/2549139
232 */
233 public function getFieldMap() {
234 return $this->container->get('entity_field.manager')->getFieldMap();
235 }
236
237 /**
238 * {@inheritdoc}
239 *
240 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
241 * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldMapByFieldType()
242 * instead.
243 *
244 * @see https://www.drupal.org/node/2549139
245 */
246 public function getFieldMapByFieldType($field_type) {
247 return $this->container->get('entity_field.manager')->getFieldMapByFieldType($field_type);
248 }
249
250 /**
251 * {@inheritdoc}
252 *
253 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
254 * Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionCreate()
255 * instead.
256 *
257 * @see https://www.drupal.org/node/2549139
258 */
259 public function onFieldDefinitionCreate(FieldDefinitionInterface $field_definition) {
260 $this->container->get('field_definition.listener')->onFieldDefinitionCreate($field_definition);
261 }
262
263 /**
264 * {@inheritdoc}
265 *
266 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
267 * Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionUpdate()
268 * instead.
269 *
270 * @see https://www.drupal.org/node/2549139
271 */
272 public function onFieldDefinitionUpdate(FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original) {
273 $this->container->get('field_definition.listener')->onFieldDefinitionUpdate($field_definition, $original);
274 }
275
276 /**
277 * {@inheritdoc}
278 *
279 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
280 * Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionDelete()
281 * instead.
282 *
283 * @see https://www.drupal.org/node/2549139
284 */
285 public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definition) {
286 $this->container->get('field_definition.listener')->onFieldDefinitionDelete($field_definition);
287 }
288
289 /**
290 * {@inheritdoc}
291 *
292 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
293 * Use \Drupal\Core\Entity\EntityFieldManagerInterface::clearCachedFieldDefinitions()
294 * instead.
295 *
296 * @see https://www.drupal.org/node/2549139
297 */
298 public function clearCachedFieldDefinitions() {
299 $this->container->get('entity_field.manager')->clearCachedFieldDefinitions();
300 }
301
302 /**
303 * {@inheritdoc}
304 *
305 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
306 * Use \Drupal\Core\Entity\EntityTypeBundleManagerInterface::clearCachedBundles()
307 * instead.
308 *
309 * @see https://www.drupal.org/node/2549139
310 */
311 public function clearCachedBundles() {
312 $this->container->get('entity_type.bundle.info')->clearCachedBundles();
313 }
314
315 /**
316 * {@inheritdoc}
317 *
318 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
319 * Use \Drupal\Core\Entity\EntityTypeBundleManagerInterface::getBundleInfo()
320 * instead.
321 *
322 * @see https://www.drupal.org/node/2549139
323 */
324 public function getBundleInfo($entity_type_id) {
325 return $this->container->get('entity_type.bundle.info')->getBundleInfo($entity_type_id);
326 }
327
328 /**
329 * {@inheritdoc}
330 *
331 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
332 * Use \Drupal\Core\Entity\EntityTypeBundleManagerInterface::getAllBundleInfo()
333 * instead.
334 *
335 * @see https://www.drupal.org/node/2549139
336 */
337 public function getAllBundleInfo() {
338 return $this->container->get('entity_type.bundle.info')->getAllBundleInfo();
339 }
340
341 /**
342 * {@inheritdoc}
343 */
344 public function getExtraFields($entity_type_id, $bundle) {
345 return $this->container->get('entity_field.manager')->getExtraFields($entity_type_id, $bundle);
346 }
347
348 /**
349 * {@inheritdoc}
350 *
351 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
352 * Use \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeLabels()
353 * instead.
354 *
355 * @see https://www.drupal.org/node/2549139
356 */
357 public function getEntityTypeLabels($group = FALSE) {
358 return $this->container->get('entity_type.repository')->getEntityTypeLabels($group);
359 }
360
361 /**
362 * {@inheritdoc}
363 *
364 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
365 * Use \Drupal\Core\Entity\EntityRepositoryInterface::getTranslationFromContext()
366 * instead.
367 *
368 * @see https://www.drupal.org/node/2549139
369 */
370 public function getTranslationFromContext(EntityInterface $entity, $langcode = NULL, $context = []) {
371 return $this->container->get('entity.repository')->getTranslationFromContext($entity, $langcode, $context);
372 }
373
374 /**
375 * {@inheritdoc}
376 *
377 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
378 * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllViewModes()
379 * instead.
380 *
381 * @see https://www.drupal.org/node/2549139
382 */
383 public function getAllViewModes() {
384 return $this->container->get('entity_display.repository')->getAllViewModes();
385 }
386
387 /**
388 * {@inheritdoc}
389 *
390 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
391 * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModes()
392 * instead.
393 *
394 * @see https://www.drupal.org/node/2549139
395 */
396 public function getViewModes($entity_type_id) {
397 return $this->container->get('entity_display.repository')->getViewModes($entity_type_id);
398 }
399
400 /**
401 * {@inheritdoc}
402 *
403 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
404 * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllFormModes()
405 * instead.
406 *
407 * @see https://www.drupal.org/node/2549139
408 */
409 public function getAllFormModes() {
410 return $this->container->get('entity_display.repository')->getAllFormModes();
411 }
412
413 /**
414 * {@inheritdoc}
415 *
416 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
417 * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModes()
418 * instead.
419 *
420 * @see https://www.drupal.org/node/2549139
421 */
422 public function getFormModes($entity_type_id) {
423 return $this->container->get('entity_display.repository')->getFormModes($entity_type_id);
424 }
425
426 /**
427 * {@inheritdoc}
428 *
429 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
430 * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptions()
431 * instead.
432 *
433 * @see https://www.drupal.org/node/2549139
434 */
435 public function getViewModeOptions($entity_type_id) {
436 return $this->container->get('entity_display.repository')->getViewModeOptions($entity_type_id);
437 }
438
439 /**
440 * {@inheritdoc}
441 *
442 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
443 * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptions()
444 * instead.
445 *
446 * @see https://www.drupal.org/node/2549139
447 */
448 public function getFormModeOptions($entity_type_id) {
449 return $this->container->get('entity_display.repository')->getFormModeOptions($entity_type_id);
450 }
451
452 /**
453 * {@inheritdoc}
454 *
455 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
456 * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptionsByBundle()
457 * instead.
458 *
459 * @see https://www.drupal.org/node/2549139
460 */
461 public function getViewModeOptionsByBundle($entity_type_id, $bundle) {
462 return $this->container->get('entity_display.repository')->getViewModeOptionsByBundle($entity_type_id, $bundle);
463 }
464
465 /**
466 * {@inheritdoc}
467 *
468 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
469 * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptionsByBundle()
470 * instead.
471 *
472 * @see https://www.drupal.org/node/2549139
473 */
474 public function getFormModeOptionsByBundle($entity_type_id, $bundle) {
475 return $this->container->get('entity_display.repository')->getFormModeOptionsByBundle($entity_type_id, $bundle);
476 }
477
478 /**
479 * {@inheritdoc}
480 *
481 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
482 * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::clearDisplayModeInfo()
483 * instead.
484 *
485 * @see https://www.drupal.org/node/2549139
486 */
487 public function clearDisplayModeInfo() {
488 $this->container->get('entity_display.repository')->clearDisplayModeInfo();
489 }
490
491 /**
492 * {@inheritdoc}
493 *
494 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
495 * Use \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByUuid()
496 * instead.
497 *
498 * @see https://www.drupal.org/node/2549139
499 */
500 public function loadEntityByUuid($entity_type_id, $uuid) {
501 return $this->container->get('entity.repository')->loadEntityByUuid($entity_type_id, $uuid);
502 }
503
504 /**
505 * {@inheritdoc}
506 *
507 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
508 * Use \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByConfigTarget()
509 * instead.
510 *
511 * @see https://www.drupal.org/node/2549139
512 */
513 public function loadEntityByConfigTarget($entity_type_id, $target) {
514 return $this->container->get('entity.repository')->loadEntityByConfigTarget($entity_type_id, $target);
515 }
516
517 /**
518 * {@inheritdoc}
519 *
520 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
521 * Use \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeFromClass()
522 * instead.
523 *
524 * @see https://www.drupal.org/node/2549139
525 */
526 public function getEntityTypeFromClass($class_name) {
527 return $this->container->get('entity_type.repository')->getEntityTypeFromClass($class_name);
528 }
529
530 /**
531 * {@inheritdoc}
532 */
533 public function onEntityTypeCreate(EntityTypeInterface $entity_type) {
534 $this->container->get('entity_type.listener')->onEntityTypeCreate($entity_type);
535 }
536
537 /**
538 * {@inheritdoc}
539 *
540 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
541 * Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeUpdate()
542 * instead.
543 *
544 * @see https://www.drupal.org/node/2549139
545 */
546 public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
547 $this->container->get('entity_type.listener')->onEntityTypeUpdate($entity_type, $original);
548 }
549
550 /**
551 * {@inheritdoc}
552 *
553 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
554 * Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeDelete()
555 * instead.
556 *
557 * @see https://www.drupal.org/node/2549139
558 */
559 public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
560 $this->container->get('entity_type.listener')->onEntityTypeDelete($entity_type);
561 }
562
563 /**
564 * {@inheritdoc}
565 *
566 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
567 * Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionCreate()
568 * instead.
569 *
570 * @see https://www.drupal.org/node/2549139
571 */
572 public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {
573 $this->container->get('field_storage_definition.listener')->onFieldStorageDefinitionCreate($storage_definition);
574 }
575
576 /**
577 * {@inheritdoc}
578 *
579 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
580 * Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionUpdate()
581 * instead.
582 *
583 * @see https://www.drupal.org/node/2549139
584 */
585 public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
586 $this->container->get('field_storage_definition.listener')->onFieldStorageDefinitionUpdate($storage_definition, $original);
587 }
588
589 /**
590 * {@inheritdoc}
591 *
592 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
593 * Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionDelete()
594 * instead.
595 *
596 * @see https://www.drupal.org/node/2549139
597 */
598 public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) {
599 $this->container->get('field_storage_definition.listener')->onFieldStorageDefinitionDelete($storage_definition);
600 }
601
602 /**
603 * {@inheritdoc}
604 *
605 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
606 * Use \Drupal\Core\Entity\EntityBundleListenerInterface::onBundleCreate()
607 * instead.
608 *
609 * @see https://www.drupal.org/node/2549139
610 */
611 public function onBundleCreate($bundle, $entity_type_id) {
612 $this->container->get('entity_bundle.listener')->onBundleCreate($bundle, $entity_type_id);
613 }
614
615 /**
616 * {@inheritdoc}
617 *
618 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
619 * Use \Drupal\Core\Entity\EntityBundleListenerInterface::onBundleDelete()
620 * instead.
621 *
622 * @see https://www.drupal.org/node/2549139
623 */
624 public function onBundleDelete($bundle, $entity_type_id) {
625 $this->container->get('entity_bundle.listener')->onBundleDelete($bundle, $entity_type_id);
626 }
627
628 /**
629 * {@inheritdoc}
630 *
631 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
632 * Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinition()
633 * instead.
634 *
635 * @see https://www.drupal.org/node/2549139
636 */
637 public function getLastInstalledDefinition($entity_type_id) {
638 return $this->container->get('entity.last_installed_schema.repository')->getLastInstalledDefinition($entity_type_id);
639 }
640
641 /**
642 * {@inheritdoc}
643 */
644 public function useCaches($use_caches = FALSE) {
645 $this->container->get('entity_type.manager')->useCaches($use_caches);
646
647 // @todo EntityFieldManager is not a plugin manager, and should not co-opt
648 // this method for managing its caches.
649 $this->container->get('entity_field.manager')->useCaches($use_caches);
650 }
651
652 /**
653 * {@inheritdoc}
654 *
655 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
656 * Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledFieldStorageDefinitions()
657 * instead.
658 *
659 * @see https://www.drupal.org/node/2549139
660 */
661 public function getLastInstalledFieldStorageDefinitions($entity_type_id) {
662 return $this->container->get('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions($entity_type_id);
663 }
664
665 /**
666 * {@inheritdoc}
667 *
668 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
669 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getDefinitions()
670 * instead.
671 *
672 * @see https://www.drupal.org/node/2549139
673 */
674 public function getDefinitions() {
675 return $this->container->get('entity_type.manager')->getDefinitions();
676 }
677
678 /**
679 * {@inheritdoc}
680 *
681 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
682 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::hasDefinition()
683 * instead.
684 *
685 * @see https://www.drupal.org/node/2549139
686 */
687 public function hasDefinition($plugin_id) {
688 return $this->container->get('entity_type.manager')->hasDefinition($plugin_id);
689 }
690
691 /**
692 * {@inheritdoc}
693 *
694 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
695 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::createInstance()
696 * instead.
697 *
698 * @see https://www.drupal.org/node/2549139
699 */
700 public function createInstance($plugin_id, array $configuration = []) {
701 return $this->container->get('entity_type.manager')->createInstance($plugin_id, $configuration);
702 }
703
704 /**
705 * {@inheritdoc}
706 *
707 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
708 * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getInstance()
709 * instead.
710 *
711 * @see https://www.drupal.org/node/2549139
712 */
713 public function getInstance(array $options) {
714 return $this->container->get('entity_type.manager')->getInstance($options);
715 }
716
717 }