| 5 node.module | node_load($param = array(), $revision = NULL, $reset = NULL) |
| 6 node.module | node_load( |
| 7 node.module | node_load($nid = NULL, $vid = NULL, $reset = FALSE) |
| 8 node.module | node_load($nid = NULL, $vid = NULL, $reset = FALSE) |
Load a node object from the database.
Parameters
$nid: The node ID.
$vid: The revision ID.
$reset: Whether to reset the node_load_multiple cache.
Return value
A fully-populated node object, or FALSE if the node is not found.
▾ 76 functions call node_load()
- book_admin_edit_submit in modules/
book/ book.admin.inc - Handle submission of the book administrative page form.
- book_block_view in modules/
book/ book.module - Implements hook_block_view().
- book_export_html in modules/
book/ book.pages.inc - This function is called by book_export() to generate HTML for export.
- book_export_traverse in modules/
book/ book.module - Traverse the book tree to build printable or exportable output.
- book_form_node_delete_confirm_alter in modules/
book/ book.module - Form altering function for the confirm form for a single node deletion.
- book_node_delete in modules/
book/ book.module - Implements hook_node_delete().
- CommentInterfaceTest::testCommentNodeCommentStatistics in modules/
comment/ comment.test - Tests the node comment statistics.
- CommentPagerTest::testCommentNewPageIndicator in modules/
comment/ comment.test - Test comment_new_page_count().
- CommentTokenReplaceTestCase::testCommentTokenReplacement in modules/
comment/ comment.test - Creates a comment, then tests the tokens generated from it.
- comment_edit_page in modules/
comment/ comment.module - Page callback for comment editing.
- comment_file_download_access in modules/
comment/ comment.module - Implements hook_file_download_access().
- comment_form in modules/
comment/ comment.module - Generate the basic commenting form, for appending to a node or display on a separate page.
- comment_form_submit in modules/
comment/ comment.module - Process comment form submissions; prepare the comment, store it, and set a redirection target.
- comment_permalink in modules/
comment/ comment.module - Redirects comment links to the correct page depending on comment settings.
- comment_preview in modules/
comment/ comment.module - Generate a comment preview.
- comment_save in modules/
comment/ comment.module - Accepts a submission of new or changed comment content.
- comment_tokens in modules/
comment/ comment.tokens.inc - Implements hook_tokens().
- EntityCrudHookTestCase::testNodeHooks in modules/
simpletest/ tests/ entity_crud_hook_test.test - Test hook invocations for CRUD operations on nodes.
- FileFieldDisplayTestCase::testNodeDisplay in modules/
file/ tests/ file.test - Tests normal formatter display on node display.
- FileFieldPathTestCase::testUploadPath in modules/
file/ tests/ file.test - Tests the normal formatter display on node display.
- FileFieldRevisionTestCase::testRevisions in modules/
file/ tests/ file.test - Tests creating multiple revisions of a node and managing attached files.
- FileFieldTestCase::uploadNodeFile in modules/
file/ tests/ file.test - Uploads a file to a node.
- FileFieldValidateTestCase::testFileExtension in modules/
file/ tests/ file.test - Tests file extension checking.
- FileFieldValidateTestCase::testFileMaxSize in modules/
file/ tests/ file.test - Tests the max file size validator.
- FileFieldValidateTestCase::testRequired in modules/
file/ tests/ file.test - Tests the required property on file fields.
- FileFieldWidgetTestCase::testMultiValuedWidget in modules/
file/ tests/ file.test - Tests upload and remove buttons for multiple multi-valued File fields.
- FileFieldWidgetTestCase::testPrivateFileSetting in modules/
file/ tests/ file.test - Tests a file field with a "Private files" upload destination setting.
- FileFieldWidgetTestCase::testSingleValuedWidget in modules/
file/ tests/ file.test - Tests upload and remove buttons for a single-valued File field.
- FilePrivateTestCase::testPrivateFile in modules/
file/ tests/ file.test - Tests file access for file uploaded to a private node.
- FileTokenReplaceTestCase::testFileTokenReplacement in modules/
file/ tests/ file.test - Creates a file, then tests the tokens generated from it.
- hook_search_execute in modules/
search/ search.api.php - Execute a search for a set of key words.
- hook_update_index in modules/
search/ search.api.php - Update the search index for this module.
- ImageAdminStylesUnitTest::testStyleReplacement in modules/
image/ image.test - Test deleting a style and choosing a replacement style.
- ImageFieldDisplayTestCase::testImageFieldDefaultImage in modules/
image/ image.test - Test use of a default image with an image field.
- ImageFieldDisplayTestCase::testImageFieldSettings in modules/
image/ image.test - Tests for image field settings.
- ImageFieldDisplayTestCase::_testImageFieldFormatters in modules/
image/ image.test - Test image formatters on node display.
- MenuTestCase::testMenu in modules/
menu/ menu.test - Login users, add menus and menu links, and test menu functionality through the admin and user interfaces.
- NodeAccessRecordsUnitTest::testNodeAccessRecords in modules/
node/ node.test - Create a node and test the creation of node access rules.
- NodeBodyUpgradePathTestCase::testNodeBodyUpgrade in modules/
simpletest/ tests/ upgrade/ upgrade.node.test - Test a successful upgrade.
- NodeRevisionsTestCase::setUp in modules/
node/ node.test - Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
- NodeRevisionsTestCase::testNodeRevisionWithoutLogMessage in modules/
node/ node.test - Checks that revisions are correctly saved without log messages.
- NodeRevisionsTestCase::testRevisions in modules/
node/ node.test - Check node revision related operations.
- NodeSaveTestCase::testDeterminingChanges in modules/
node/ node.test - Tests determing changes in hook_node_presave() and verifies the static node load cache is cleared upon save.
- NodeSaveTestCase::testImport in modules/
node/ node.test - Import test, to check if custom node ids are saved properly. Workflow:
- NodeTokenReplaceTestCase::testNodeTokenReplacement in modules/
node/ node.test - Creates a node, then tests the tokens generated from it.
- node_access_rebuild in modules/
node/ node.module - Rebuild the node access database. This is occasionally needed by modules that make system-wide changes to access levels.
- node_delete_confirm_submit in modules/
node/ node.pages.inc - Execute node deletion
- node_help in modules/
node/ node.module - Implements hook_help().
- node_revision_delete in modules/
node/ node.module - Delete a node revision.
- node_search_execute in modules/
node/ node.module - Implements hook_search_execute().
- PageEditTestCase::testPageAuthoredBy in modules/
node/ node.test - Check changing node authored by fields.
- PageEditTestCase::testPageEdit in modules/
node/ node.test - Check node edit functionality.
- PageViewTestCase::testPageView in modules/
node/ node.test - Creates a node and then an anonymous and unpermissioned user attempt to edit the node.
- PollCreateTestCase::testPollCreate in modules/
poll/ poll.test - PollTokenReplaceTestCase::testPollTokenReplacement in modules/
poll/ poll.test - Creates a poll, then tests the tokens generated from it.
- poll_block_view in modules/
poll/ poll.module - Implements hook_block_view().
- poll_cancel in modules/
poll/ poll.module - Submit callback for poll_cancel_form().
- profile_block_view in modules/
profile/ profile.module - Implements hook_block_view().
- statistics_node_tracker in modules/
statistics/ statistics.pages.inc - SummaryLengthTestCase::testSummaryLength in modules/
node/ node.test - Creates a node and then an anonymous and unpermissioned user attempt to edit the node.
- translation_language_switch_links_alter in modules/
translation/ translation.module - Implements hook_language_switch_links_alter().
- translation_node_overview in modules/
translation/ translation.pages.inc - Overview page for a node's translations.
- translation_node_prepare in modules/
translation/ translation.module - Implements hook_node_prepare().
- translation_path_get_translations in modules/
translation/ translation.module - Return paths of all translations of a node, based on its Drupal path.
- UpgradePathTaxonomyTestCase::testTaxonomyUpgrade in modules/
simpletest/ tests/ upgrade/ upgrade.taxonomy.test - Basic tests for the taxonomy upgrade.
- UploadUpgradePathTestCase::testUploadUpgrade in modules/
simpletest/ tests/ upgrade/ upgrade.upload.test - Test a successful upgrade.
- UserCancelTestCase::testUserAnonymize in modules/
user/ user.test - Delete account and anonymize all content.
- UserCancelTestCase::testUserBlockUnpublish in modules/
user/ user.test - Disable account and unpublish all content.
- UserCancelTestCase::testUserCancelInvalid in modules/
user/ user.test - Attempt invalid account cancellations.
- UserCancelTestCase::testUserCancelWithoutPermission in modules/
user/ user.test - Attempt to cancel account without permission.
- UserCancelTestCase::testUserDelete in modules/
user/ user.test - Delete account and remove all content.
- _node_index_node in modules/
node/ node.module - Index a single node.
- _node_mass_update_helper in modules/
node/ node.admin.inc - Node Mass Update - helper function.
- _node_revision_access in modules/
node/ node.module - _trigger_normalize_comment_context in modules/
trigger/ trigger.module - Loads associated objects for comment triggers.
- _trigger_normalize_user_context in modules/
trigger/ trigger.module - Loads associated objects for user triggers.
File
- modules/
node/ node.module, line 924 - 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
<?php
function node_load($nid = NULL, $vid = NULL, $reset = FALSE) {
$nids = (isset($nid) ? array($nid) : array());
$conditions = (isset($vid) ? array('vid' => $vid) : array());
$node = node_load_multiple($nids, $conditions, $reset);
return $node ? reset($node) : FALSE;
}
?> Login or register to post comments
Comments
node load from a title
in D6:
$node = node_load(array('title' => $text, 'type' => 'mytype'));echo $node->body;
in D7 (i think):
$query = new EntityFieldQuery;
$result = $query
->entityCondition('entity_type', 'node')
->propertyCondition('type', 'mytype')
->propertyCondition('title', $text)
->execute();
if (!empty($result['node'])) {
$nodes = node_load_multiple(array_keys($result['node']));
echo current($nodes)->body['und'][0]['safe_value'];
}
uggghhh!!
I concur
@liquidcms, I agree with your uggghhh!! to the point of writing a module to supply the functionality. One day, when Git has a decent user interface, I will load the code into drupal.org.
http://petermoulding.com/node_load_from_title
Node load
Or you can try entity_load :
$items = entity_load('node', FALSE, array('type' => 'mytype', 'title' => $text));