annotate core/lib/Drupal/Core/Entity/EntityManager.php @ 19:fa3358dc1485 tip

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