Deprecated - 8.9.x - drupal

Primary tabs

Title File name Deprecation Type Direct uses Namespaced uses Overrides Use statements
EntityManager::useCaches core/lib/Drupal/Core/Entity/EntityManager.php

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.

function
EntityManagerInterface core/lib/Drupal/Core/Entity/EntityManagerInterface.php

in drupal:8.0.0 and is removed from drupal:9.0.0.

interface 1 8
EntityManagerInterface::getLastInstalledDefinition core/lib/Drupal/Core/Entity/EntityManagerInterface.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinition() instead.

function 1
EntityManagerInterface::getLastInstalledFieldStorageDefinitions core/lib/Drupal/Core/Entity/EntityManagerInterface.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledFieldStorageDefinitions() instead.

function 1
EntityReference core/modules/entity_reference/src/Plugin/views/row/EntityReference.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\views\Plugin\views\row\EntityReference instead.

class
EntityReference core/modules/entity_reference/src/Plugin/views/display/EntityReference.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\views\Plugin\views\display\EntityReference instead.

class
EntityReference core/modules/entity_reference/src/Plugin/views/style/EntityReference.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\views\Plugin\views\style\EntityReference instead.

class
EntityReference core/lib/Drupal/Core/Field/Plugin/migrate/field/d7/EntityReference.php

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\field\Plugin\migrate\field\d7\EntityReference instead.

class 1
EntityReferenceTestTrait core/modules/field/src/Tests/EntityReference/EntityReferenceTestTrait.php

in drupal:8.6.2 and is removed from drupal:9.0.0. Use Drupal\Tests\field\Traits\EntityReferenceTestTrait instead.

trait
EntityTestBundleResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/EntityTestBundle/EntityTestBundleResourceTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\entity_test\Functional\Rest\EntityTestBundleResourceTestBase instead.

class
EntityTestLabelResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/EntityTestLabel/EntityTestLabelResourceTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\entity_test\Functional\Rest\EntityTestLabelResourceTestBase instead.

class
EntityTestResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestResourceTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\entity_test\Functional\Rest\EntityTestResourceTestBase instead.

class
EntityType::$label_callback core/lib/Drupal/Core/Entity/EntityType.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Override the EntityInterface::label() method instead for dynamic labels.

property
EntityTypeInterface::getLabelCallback core/lib/Drupal/Core/Entity/EntityTypeInterface.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Override the EntityInterface::label() method instead for dynamic labels.

function 1
EntityTypeInterface::getLowercaseLabel core/lib/Drupal/Core/Entity/EntityTypeInterface.php

in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, you should call getSingularLabel(). See https://www.drupal.org/node/3075567

function 1
EntityTypeInterface::hasLabelCallback core/lib/Drupal/Core/Entity/EntityTypeInterface.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Override the EntityInterface::label() method instead for dynamic labels.

function 1
EntityTypeInterface::isSubclassOf core/lib/Drupal/Core/Entity/EntityTypeInterface.php

in drupal:8.3.0 and is removed from drupal:10.0.0. Use Drupal\Core\Entity\EntityTypeInterface::entityClassImplements() instead.

function 1
EntityTypeInterface::setLabelCallback core/lib/Drupal/Core/Entity/EntityTypeInterface.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Override the EntityInterface::label() method instead for dynamic labels.

function 1
EntityTypeRepositoryInterface::clearCachedDefinitions core/lib/Drupal/Core/Entity/EntityTypeRepositoryInterface.php

in drupal:8.0.0 and is removed from drupal:9.0.0.

function 1
EntityUnitTestBase core/modules/system/src/Tests/Entity/EntityUnitTestBase.php

in drupal:8.1.0 and is removed from drupal:9.0.0. Use \Drupal\KernelTests\Core\Entity\EntityKernelTestBase instead.

class
EntityViewDisplayResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/EntityViewDisplay/EntityViewDisplayResourceTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\FunctionalTests\Rest\EntityViewDisplayResourceTestBase instead.

class
EntityViewModeResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/EntityViewMode/EntityViewModeResourceTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\FunctionalTests\Rest\EntityViewModeResourceTestBase instead.

class
EntityWithUriCacheTagsTestBase core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\system\Functional\Entity\EntityWithUriCacheTagsTestBase.

class
entity_create core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use The method overriding Entity::create() for the entity type, e.g. \Drupal\node\Entity\Node::create() if the entity type is known. If the entity type is variable, use the entity storage's create() method to construct a new entity:

\Drupal::entityTypeManager()->getStorage($entity_type)
    ->create($values);
function 1
entity_delete_multiple core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity storage's \Drupal\Core\Entity\EntityStorageInterface::delete() method to delete multiple entities:

$storage_handler = \Drupal::entityTypeManager()->getStorage($entity_type);
$entities = $storage_handler->loadMultiple($ids);
$storage_handler->delete($entities);
function 2
entity_get_bundles core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() for a single bundle, or \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() for all bundles.

function 1
entity_get_display core/includes/entity.inc

in drupal:8.8.0 and is removed from drupal:9.0.0. Use EntityDisplayRepositoryInterface::getViewDisplay() instead.

function 1
entity_get_form_display core/includes/entity.inc

in drupal:8.8.0 and is removed from drupal:9.0.0. Use EntityDisplayRepositoryInterface::getFormDisplay() instead.

function 1
entity_load core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity type storage's load() method.

function 1
entity_load_multiple core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity type storage's loadMultiple() method.

function 1
entity_load_multiple_by_properties core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity type storage's loadByProperties() method.

function 1
entity_load_unchanged core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity type storage's loadUnchanged() method.

function 1
entity_page_label core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity's label() method.

function 1
entity_render_cache_clear core/includes/entity.inc

in drupal:8.7.0 and is removed from drupal:9.0.0. Instead, use \Drupal\Core\Entity\EntityViewBuilderInterface::resetCache() on the required entity types or invalidate specific cache tags.

function
entity_revision_delete core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity type storage's deleteRevision() method.

function 1
entity_revision_load core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity type storage's loadRevision() method.

function 1
entity_test_load core/modules/system/tests/modules/entity_test/entity_test.module

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::entityTypeManager()->getStorage('entity_test')->load().

function
entity_test_mulrev_load core/modules/system/tests/modules/entity_test/entity_test.module

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::entityTypeManager()->getStorage('entity_test_mulrev_load')->load().

function
entity_test_mul_load core/modules/system/tests/modules/entity_test/entity_test.module

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::entityTypeManager()->getStorage('entity_test_mul')->load().

function
entity_test_rev_load core/modules/system/tests/modules/entity_test/entity_test.module

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::entityTypeManager()->getStorage('entity_test_rev')->load().

function
entity_view core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity view builder's view() method for creating a render array:

$view_builder = \Drupal::entityTypeManager()->getViewBuilder($entity->getEntityTypeId());
return $view_builder->view($entity, $view_mode, $langcode);
function 1
entity_view_multiple core/includes/entity.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the entity view builder's viewMultiple() method for creating a render array for the provided entities:

$view_builder = \Drupal::entityTypeManager()->getViewBuilder($entity->getEntityTypeId());
return $view_builder->viewMultiple($entities, $view_mode, $langcode);
function 1
ExpectDeprecationTrait::expectDeprecation core/tests/Drupal/Tests/Traits/ExpectDeprecationTrait.php

in drupal:8.8.5 and is removed from drupal:9.0.0. Use ::addExpectedDeprecationMessage() instead.

function 1
FakeRecord core/modules/system/src/Tests/Database/FakeRecord.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Instead use \Drupal\Tests\system\Functional\Database\FakeRecord.

class
FeedHalJsonTestBase core/modules/hal/tests/src/Functional/EntityResource/Feed/FeedHalJsonTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\aggregator\Functional\Hal\FeedHalJsonTestBase instead.

class
FeedResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/Feed/FeedResourceTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\aggregator\Functional\Rest\FeedResourceTestBase instead.

class
Field core/modules/views/src/Plugin/views/field/Field.php

in drupal:8.3.0 and is removed from drupal:9.0.0. Use \Drupal\views\Plugin\views\field\EntityField instead.

class
FieldAPIHandlerTrait::getEntityManager core/modules/views/src/FieldAPIHandlerTrait.php

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\views\FieldAPIHandlerTrait::getEntityFieldManager() instead.

function
FieldConfigResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/FieldConfig/FieldConfigResourceTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\field\Functional\Rest\FieldConfigResourceTestBase instead.

class
FieldFile::$migrationPlugin core/modules/file/src/Plugin/migrate/process/d6/FieldFile.php

in drupal:8.8.x and is removed from drupal:9.0.0. Use the migrate.lookup service instead.

property

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.