You are here

function Notifications_Event::load_objects in Notifications 6.4

Load event objects

Return value

Boolean Object status, FALSE for incomplete (missing object)

3 calls to Notifications_Event::load_objects()
Notifications_Event::get_object in includes/notifications_event.class.inc
Get single object
Notifications_Event::get_objects in includes/notifications_event.class.inc
Get event objects
Notifications_Event::object in includes/notifications_event.class.inc
Get set event object

File

includes/notifications_event.class.inc, line 231
Drupal Notifications Framework - Default class file

Class

Notifications_Event
Message destination class

Code

function load_objects($refresh = FALSE) {
  if (!isset($this->objects) || $refresh) {
    $this->objects = array();
    if (!empty($this->params['objects'])) {
      foreach ($this->params['objects'] as $type => $value) {
        if (is_object($value)) {

          // This object was serialized along with the event, just set it
          $this->objects[$type] = $value;
        }
        elseif ($object = notifications_object_load($type, $value)) {
          $this->objects[$type] = $object;
        }
        else {

          // Cannot find object, mark as incomplete and return FALSE
          $this->incomplete = TRUE;
          return FALSE;
        }
      }
    }
  }

  // Return true unless marked as incomplete
  return $this->incomplete ? FALSE : TRUE;
}