You are here

public function Notifications_Subscription_List::add in Notifications 7

Add subscription/s to the list

1 call to Notifications_Subscription_List::add()
Notifications_Subscription_List::load_multiple in ./notifications.list.inc
Load multiple subscriptions into the list

File

./notifications.list.inc, line 38
Drupal Notifications Framework - Default class file

Class

Notifications_Subscription_List
List of subscriptions or subscription types

Code

public function add($items) {
  if (is_array($items)) {
    foreach ($items as $item) {
      $this
        ->add($item);
    }
  }
  elseif (is_object($items)) {
    if (is_a($items, 'Notifications_Subscription_List')) {
      $this
        ->add($items
        ->get_subscriptions());
    }
    elseif (is_a($items, 'Notifications_Subscription')) {
      $this
        ->add_subscription($items);
    }
  }
  return $this;
}