You are here

public function Messaging_Object::__construct in Messaging 6.4

Same name and namespace in other branches
  1. 7 messaging.module \Messaging_Object::__construct()

Constructor, with predefined array of data

1 call to Messaging_Object::__construct()
Messaging_Destination::__construct in includes/messaging_destination.class.inc
Constructor
1 method overrides Messaging_Object::__construct()
Messaging_Destination::__construct in includes/messaging_destination.class.inc
Constructor

File

includes/messaging_object.class.inc, line 155
Drupal Messaging Framework - Base classes

Class

Messaging_Object
Messaging persistent object

Code

public function __construct($template = NULL) {
  if ($template) {
    foreach ($template as $key => $value) {
      $this->{$key} = $value;
    }
  }

  // If loaded from db, may need unserialize
  if ($this
    ->key()) {
    $this
      ->unserialize();
  }

  // Make sure all objects have language
  if (!isset($this->language)) {
    $this
      ->set_language();
  }
}