function Notifications_Subscription::set_fields in Notifications 6.4
Same name and namespace in other branches
- 7 notifications.subscription.inc \Notifications_Subscription::set_fields()
Set field values, all at a time
Each field item may have different formats:
- Numeric key => field type. Like array(nid, tid)
- Numeric key => array('type' => type, 'value' => value)
- Numeric key => Object ($field object with field, value properties)
Parameters
$fields: Fields is an array of field items, each of them with many possible formats: NULL to set the fields from the subscription type or template if not set
4 calls to Notifications_Subscription::set_fields()
- Notifications_Subscription::check_fields in includes/
notifications_subscription.class.inc - Check all fields are there and optinally that they have a value
- Notifications_Subscription::get_fields in includes/
notifications_subscription.class.inc - Get fields as array of field objects
- Notifications_Subscription::set_properties in includes/
notifications_subscription.class.inc - Save fields from form submission
- Notifications_Subscription::__set in includes/
notifications_subscription.class.inc - Magic method, set protected properties
File
- includes/
notifications_subscription.class.inc, line 578 - Drupal Notifications Framework - Default class file
Class
- Notifications_Subscription
- Message destination class
Code
function set_fields($fields = NULL, $normalize = TRUE) {
if (isset($fields)) {
$this->fields = array();
$this
->add_fields($fields, $normalize);
}
elseif (!isset($this->fields)) {
// Set the fields from the subscription type or template
$this->fields = array();
$this
->add_fields($this
->get_type_fields(), FALSE);
}
}