function Notifications_Subscription::get_instance_fields in Notifications 7
Same name and namespace in other branches
- 6.4 includes/notifications_subscription.class.inc \Notifications_Subscription::get_instance_fields()
Get instance fields that don't have a value set for this type
3 calls to Notifications_Subscription::get_instance_fields()
- Notifications_Subscription::get_editable_fields in ./
notifications.subscription.inc - Get editable fields, the ones that are not set for type
- Notifications_Subscription::is_editable in ./
notifications.subscription.inc - Whether this subscription's fields are editable or not
- Notifications_Subscription::map_field in ./
notifications.subscription.inc - Map field to its right position in this subscription
File
- ./
notifications.subscription.inc, line 1268 - Drupal Notifications Framework - Default class file
Class
- Notifications_Subscription
- Common base for subscription type and subscription instance
Code
function get_instance_fields() {
$this
->get_fields();
$editable = array();
foreach ($this
->type_fields(FALSE) as $type_field) {
// Get current instance field if available, new one (from type) if not
if ($field = $this
->get_field($type_field->position)) {
$editable[$field->position] = $field;
}
else {
$this
->set_field($type_field);
$editable[$type_field->position] = $type_field;
}
}
return $editable;
}