Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#5 | 3031756-5.patch | 3.35 KB | idebr |
Comments
Comment #2
idebr CreditAttribution: idebr at ezCompany commentedAttached patch updates references to the deprecated EntityManager in core/lib/Drupal/Core/Entity/entity.api.php to their non-deprecated version.
Comment #4
joachim CreditAttribution: joachim as a volunteer commentedThe 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?
Comment #5
idebr CreditAttribution: idebr at ezCompany commentedReroll against 8.7.x
Comment #6
BerdirLooks 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.
Comment #7
catchCommitted b503e4c and pushed to 8.7.x. Thanks!