You are here

function Notifications_Subscription::type_fields in Notifications 7

Get subscription type fields as array of field objects

4 calls to Notifications_Subscription::type_fields()
Notifications_Subscription::check_fields in ./notifications.subscription.inc
Check all fields are there and they have a value
Notifications_Subscription::get_instance_fields in ./notifications.subscription.inc
Get instance fields that don't have a value set for this type
Notifications_Subscription::get_type_fields in ./notifications.subscription.inc
Get type fields, the ones that have a value set for this type
Notifications_Subscription::set_fields in ./notifications.subscription.inc
Set field values, all at a time from the ones coming from the subscription type.

File

./notifications.subscription.inc, line 1619
Drupal Notifications Framework - Default class file

Class

Notifications_Subscription
Common base for subscription type and subscription instance

Code

function type_fields($filter = NULL) {
  $fields = array();
  $values = $this
    ->field_values();
  foreach ($this
    ->field_types() as $index => $type) {
    $fields[$index] = Notifications_Field::build_type($type, array(
      'value' => $values[$index],
      'position' => $index,
    ));
  }
  return $this
    ->filter_fields($fields, $filter);
}