function oa_core_get_parents in Open Atrium Core 7.2
Get parent Spaces and Groups.
Parameters
int $nid: The NID of the Space or Group to check.
string|NULL $bundle: (optional) The node type (default: OA_SPACE_TYPE). If NULL is passed, it will include all node types. Can also be an array of types.
int|NULL $status: (optional) If specified, the node status (ex. NODE_PUBLISHED or NODE_NOT_PUBLISHED) to look for. If not specified, it return nodes of either status.
bool $include_archived: (optional) Whether to include archived nodes or not. By default, archived items aren't included.
Return value
array Array of parent NIDs to titles.
2 calls to oa_core_get_parents()
- OgSubspacesSelectionHandler::validateReferencableEntities in plugins/
entityreference/ selection/ OgSubspacesSelectionHandler.class.php - Implements EntityReferenceHandler::validateReferencableEntities().
- _oa_core_build_visibility_links in includes/
oa_core.access.inc - Helper function, builds links for the various visibility fields on content.
File
- includes/
oa_core.util.inc, line 337 - Code for Utility functions for OpenAtrium spaces
Code
function oa_core_get_parents($nid, $bundle = OA_SPACE_TYPE, $status = NULL, $include_archived = FALSE, $fetch_all = FALSE, $account = NULL) {
$parents = oa_core_get_parents_with_titles($nid, $bundle, $status, $include_archived, $fetch_all, $account);
return array_keys($parents);
}