function notifications_array_info in Notifications 6.4
Get information from an array of data
Parameters
$data: Array of data indexed by type
$type: Type to return out of the array, none to return all types
$property: Property to return, none to return all properties
5 calls to notifications_array_info()
- notifications_event_types in ./
notifications.module - Get event types. Invoking this function will also load the event API
- notifications_object_type in ./
notifications.module - Get info about object types
- notifications_subscription_fields in ./
notifications.module - Get information about subscriptions fields
- notifications_subscription_types in ./
notifications.module - Get info about subscription types
- notifications_ui_subscription_types in notifications_ui/
notifications_ui.module - Get info about subscription types, exclude custom types
File
- ./
notifications.module, line 1160 - Notifications module
Code
function notifications_array_info($data, $type = NULL, $field = NULL) {
if ($field && $type) {
return isset($data[$type][$field]) ? $data[$type][$field] : NULL;
}
elseif ($field) {
$return = array();
foreach ($data as $id => $info) {
$return[$id] = isset($info[$field]) ? $info[$field] : NULL;
}
return $return;
}
elseif ($type) {
return isset($data[$type]) ? $data[$type] : array();
}
else {
return $data;
}
}