You are here

protected function Notifications_Subscription::set_fields_from_values in Notifications 7

Build instance fields form URL parameters

Parameters

$values: Array of field values indexed by field position

File

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

Class

Notifications_Subscription
Common base for subscription type and subscription instance

Code

protected function set_fields_from_values($values = array()) {
  $this->result = TRUE;

  // Set field values, they come in the query string indexed by field position
  foreach ($this
    ->get_editable_fields() as $field) {
    if (isset($values[$field->position])) {

      // Validate (TRUE) and set value
      $this->result = $this->result && $field
        ->set_value($values[$field->position], TRUE);
    }
  }
  return $this;
}