You are here

function Notifications_Subscription_List::load_instances in Notifications 7

Load stored instances for subscriptions in the list

1 call to Notifications_Subscription_List::load_instances()
Notifications_Subscription_List::get_instances in ./notifications.list.inc
Get all of the subscriptions that are actual instances

File

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

Class

Notifications_Subscription_List
List of subscriptions or subscription types

Code

function load_instances() {
  if (!$this->loaded) {
    foreach ($this->subscriptions as $key => $subscription) {
      if (!$subscription
        ->is_stored() && ($stored = $subscription
        ->get_instance())) {

        // Carry name over to the new one as it may be page specific
        if (!empty($subscription->name)) {
          $stored->name = $subscription->name;
        }
        $this->subscriptions[$key] = $stored;
      }
    }
    $this->loaded = TRUE;
  }
  return $this;
}