You are here

function Notifications_Subscription::get_unique_fields in Notifications 7

Get unique field per type.

A subscription may have more than one field of the same type

1 call to Notifications_Subscription::get_unique_fields()
Notifications_Subscription::object_conditions in ./notifications.subscription.inc
Get OR'd field conditions for this subscription type and object

File

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

Class

Notifications_Subscription
Common base for subscription type and subscription instance

Code

function get_unique_fields() {
  $fields = array();
  foreach ($this
    ->get_fields() as $field) {
    if (!isset($fields[$field->type])) {
      $fields[$field->type] = clone $field;
      unset($fields[$field->type]->position);
    }
  }
  return $fields;
}