Problem/Motivation

This is a followup of entity_load() is actually entity_load_multiple(). We should standardize foo_load() due to inconsistencies (e.g. node_load() and taxonomy_term_load()).

Proposed resolution

@todo

Remaining tasks

@todo

User interface changes

N/A

API changes

@todo

Comments

ryan.ryan’s picture

Issue summary: View changes

Adding a full issue summary template.

ryan.ryan’s picture

Issue summary: View changes

Updated issue summary.

ryan.ryan’s picture

Issue summary: View changes

Updated issue summary.

ryan.ryan’s picture

Title: Standardizing foo_load() » Standardizing [entity_type]_load()

Changing the title.

ryan.ryan’s picture

Issue summary: View changes

Updated issue summary.

fago’s picture

Issue tags: +Entity system, +sprint

from http://drupal.org/node/1160566#comment-5862430

Does the default for $nid need to be changed to FALSE here? In either case we should improve the parameter documentation to explain what happens if you pass NULL or whatever the default is. (I also think the datatype should be int|null given the current code, right? Same for $vid.)

The behavior of node_load() is also totally inconsistent with other functions, e.g. taxonomy_term_load(). I'm thinking if the foo_load() are all wrappers for entity_load_multiple() in the end, we should standardize them as well. Thoughts?

Agreed.

The $id parameter for foo_load() and foo_load_multiple() functions should follow the defaults of entity_load() and entity_load_multiple() and then just call this respective functions. For now, just node_load() has to stay a bit different has it's the only entity type that is revisionable. (We should do entity_revision_load(), but that's another issue.)

berdir’s picture

#1184272: Remove deprecated $conditions support from entity controller alread goes a long way in regards to removing the $vid from node_load().

berdir’s picture

Status: Active » Closed (duplicate)

#1538368: Standardizing [entity_type]_load() went in and I opened #1538368: Standardizing [entity_type]_load() which should result in unified load functions everywhere, closing this as a duplicate of those.

berdir’s picture

Issue summary: View changes

Added todos