API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...

The section titled "Loading, querying, and rendering entities" states

To load entities, use the entity storage manager, which is an object implementing \Drupal\Core\Entity\EntityStorageInterface that you can retrieve with:

$storage = \Drupal::entityManager()
->getStorage('your_entity_type');

However, Drupal::entityManager is depreciated (according to Drupal::entityManager

So - if published method of retrieving an entity is inaccurate, where do we find up-to-date information?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TMWagner created an issue. See original summary.

idebr’s picture

Title: Obsolete and incomplete » core/lib/Drupal/Core/Entity/entity.api.php references deprecated \Drupal::entityManager
Version: 8.6.9 » 8.7.x-dev
Status: Active » Needs review
FileSize
3.35 KB

Attached patch updates references to the deprecated EntityManager in core/lib/Drupal/Core/Entity/entity.api.php to their non-deprecated version.

Status: Needs review » Needs work

The last submitted patch, 2: 3031756-2.patch, failed testing. View results

joachim’s picture

Issue tags: -entity API

The patch looks like it's making the right changes, but the testbot's saying it's not applying. Perhaps you've rolled it against the wrong git branch?

idebr’s picture

Status: Needs work » Needs review
FileSize
3.35 KB

Reroll against 8.7.x

Berdir’s picture

Status: Needs review » Reviewed & tested by the community
Parent issue: » #2886622: Deprecate all EntityManager methods with E_USER_DEPRECATED

Looks good. Adding to the meta issue about deprecating all the entity manager things. This isn't covered anywhere else yet, so seems fine as a separate issue.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed b503e4c and pushed to 8.7.x. Thanks!

  • catch committed b503e4c on 8.7.x
    Issue #3031756 by idebr, TMWagner, joachim: core/lib/Drupal/Core/Entity/...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.