API page: https://api.drupal.org/api/drupal/includes%21entity.inc/property/DrupalD...

The internal entity cache on entity controllers is internal... so in most cases you don't need to know what its structure is... unless you're subclassing the controller for your own entity type. Or you're working on a core patch ;)

I assume from a quick read of the code that it's keyed by entity ID.

Comments

jhodgdon’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7

https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityStor...

Seems like this is the D8 version... with same problem.

wouters_f’s picture

Status: Active » Needs review
StatusFileSize
new818 bytes

you mean like this..?

jhodgdon’s picture

That looks fine! Can someone review and verify that this is correct information?

jhodgdon’s picture

Status: Needs review » Needs work

I have verified that this analysis is correct.

However, in verifying it I noticed that the cache-related methods on this class also need this documented. cacheSet() needs this in @param $entities, and cacheGet() in the @return.

berdir’s picture

+++ b/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php
@@ -14,6 +14,8 @@
   /**
    * Static cache of entities.
+   * ¶
+   * Array keyed by entity ID.
    *
    * @var array

Maybe simplify to "Static cache of entities, keyed by entity ID.", possibly just keyed by ID?

jhodgdon’s picture

Good idea.

pushpinderchauhan’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new524 bytes

Last patch is unable to apply, so no interdiff file. Please review attached patch.

slashrsm’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 4de4bad and pushed to 8.x. Thanks!

  • alexpott committed 4de4bad on 8.x
    Issue #2098129 by er.pushpinderrana, drupal_sensei | joachim: Fixed...
pushpinderchauhan’s picture

Version: 8.x-dev » 7.x-dev
Assigned: Unassigned » pushpinderchauhan
Status: Fixed » Patch (to be ported)

Back to D7 for backport.

pushpinderchauhan’s picture

Assigned: pushpinderchauhan » Unassigned
Status: Patch (to be ported) » Needs review
StatusFileSize
new404 bytes

Patch for D7.

Status: Needs review » Needs work

The last submitted patch, 12: drupal7-entity-documentation-2098129-11.patch, failed testing.

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Some weird test failure. Patch looks fine.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 12: drupal7-entity-documentation-2098129-11.patch, failed testing.

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community
jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again! Committed to 7.x.

  • jhodgdon committed 89d7c05 on 7.x
    Issue #2098129 by er.pushpinderrana, drupal_sensei, Berdir, joachim: Fix...

Status: Fixed » Closed (fixed)

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