function node_load_multiple
7.x node.module | node_load_multiple($nids = array(), $conditions = array(), $reset = FALSE) |
Loads node entities from the database.
This function should be used whenever you need to load more than one node from the database. Nodes are loaded into memory and will not require database access if loaded again during the same page request.
@todo Remove $conditions in Drupal 8.
Parameters
$nids: An array of node IDs.
$conditions: (deprecated) An associative array of conditions on the {node} table, where the keys are the database fields and the values are the values those fields must have. Instead, it is preferable to use EntityFieldQuery to retrieve a list of entity IDs loadable by this function.
$reset: Whether to reset the internal node_load cache.
Return value
An array of node objects indexed by nid.
See also
13 calls to node_load_multiple()
- blog_page_last in drupal-7.x/
modules/ blog/ blog.pages.inc - Menu callback; displays a Drupal page containing recent blog entries of all users.
- blog_page_user in drupal-7.x/
modules/ blog/ blog.pages.inc - Menu callback; displays a Drupal page containing recent blog entries of a given user.
- DrupalWebTestCase::drupalGetNodeByTitle in drupal-7.x/
modules/ simpletest/ drupal_web_test_case.php - Get a node from the database based on its title.
- NodeLoadHooksTestCase::testHookNodeLoad in drupal-7.x/
modules/ node/ node.test - Test that hook_node_load() is invoked correctly.
- NodeLoadMultipleTestCase::testNodeMultipleLoad in drupal-7.x/
modules/ node/ node.test - Create four nodes and ensure they're loaded correctly.
File
- drupal-7.x/
modules/ node/ node.module, line 945 - The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.
Code
function node_load_multiple($nids = array(), $conditions = array(), $reset = FALSE) {
return entity_load('node', $nids, $conditions, $reset);
}