- πΊπΈUnited States smustgrave
Reading the comments seems there's still discussion on the approach that should be taken.
Tagged for IS update so when that solution is decided on it can be added there.
Thanks!
We accomplish this currently by passing a NULL argument to loadMultiple:
/**
* Loads one or more entities.
*
* @param $ids
* An array of entity IDs, or NULL to load all entities.
*
* @return
* An array of entity objects indexed by their ids.
*/
public function loadMultiple(array $ids = NULL);
Not only is it generally a bad coding practice to accept multiple types in a method signature, but this behavior isn't exactly intuitive. I noticed this while working on
#597236: Add entity caching to core β
, which has excessive conditional logic to account for the multiple argument types. It also should be noted in Drupal 7 one needed to pass FALSE
to entity_load
instead of NULL
which just adds to the confusion.
It would be a lot simpler to just add loadAll and let loadMultiple require an array.
Needs work
9.5
Enhances an existing API or introduces a new subsystem. Depending on the size and impact, possibly backportable to earlier major versions.
Used to track the progress of issues reviewed by the Drupal Needs Review Queue Initiative.
Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Reading the comments seems there's still discussion on the approach that should be taken.
Tagged for IS update so when that solution is decided on it can be added there.
Thanks!