You are here

public function Notifications_Subscription::set_properties in Notifications 7

Same name and namespace in other branches
  1. 6.4 includes/notifications_subscription.class.inc \Notifications_Subscription::set_properties()

Save fields from form submission

File

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

Class

Notifications_Subscription
Common base for subscription type and subscription instance

Code

public function set_properties($values, $fields) {
  foreach ($fields as $key) {
    if (isset($values[$key])) {
      switch ($key) {
        case 'fields':
          if (!empty($values['parsed_fields'])) {
            $this
              ->set_fields($values['parsed_fields']);
          }
          else {
            $this
              ->set_fields($values['fields']);
          }
          break;
        case 'destination':
          $this
            ->set_destination($values[$key]);
          break;
        default:
          $this->{$key} = $values[$key];
          break;
      }
    }
  }
}