You are here

public static function Messaging_Destination::create in Messaging 6.4

Same name and namespace in other branches
  1. 7 messaging.destination.inc \Messaging_Destination::create()

Create from array data

File

includes/messaging_destination.class.inc, line 173
Drupal Messaging Framework - Default class file

Class

Messaging_Destination
Message destination class

Code

public static function create($data) {

  // If no more clues, we create it for anonymous user
  $data += array(
    'uid' => 0,
    'method' => NULL,
    'type' => NULL,
    'address' => NULL,
  );
  if ($data['type'] && $data['address']) {
    return self::create_type($data['type'], $data['address'], $data['uid']);
  }
  else {
    return self::create_method($data['method'], $data['address'], $data['uid']);
  }
}