function profile2_load in Profile 2 7.2
Same name and namespace in other branches
- 7 profile2.module \profile2_load()
Fetch a profile object.
Parameters
$pid: Integer specifying the profile id.
$vid: Integer specifying the revision id.
$reset: A boolean indicating that the internal cache should be reset.
Return value
A fully-loaded $profile object or FALSE if it cannot be loaded.
See also
10 calls to profile2_load()
- Profile2CRUDTestCase::testCRUD in ./
profile2.test - Tests CRUD for a profile related to a user and one unrelated to a user.
- profile2_diff_block_view in contrib/
profile2_diff.module - Implements hook_block_view().
- profile2_diff_diffs_show in contrib/
profile2_diff.pages.inc - Create output string for a comparison of 'profile' between versions 'old_vid' and 'new_vid'.
- profile2_diff_inline_show in contrib/
profile2_diff.pages.inc - Show the inline diff of a given profile object v. the profile with $old_vid. If $old_vid = 0 returns the normally rendered content of the profile object. If metadata is TRUE a header will be added with a legend explaining the color code. This function…
- profile2_load_by_user in ./
profile2.module - Fetch profiles by account.
File
- ./
profile2.module, line 392 - Support for configurable user profiles.
Code
function profile2_load($pid, $vid = NULL, $reset = FALSE) {
$pids = isset($pid) ? array(
$pid,
) : array();
$conditions = isset($vid) ? array(
'vid' => $vid,
) : array();
$profiles = profile2_load_multiple($pids, $conditions, $reset);
return reset($profiles);
}