You are here

public static function Messaging_Destination::create in Messaging 7

Same name and namespace in other branches
  1. 6.4 includes/messaging_destination.class.inc \Messaging_Destination::create()

Create from array data

File

./messaging.destination.inc, line 245
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']);
  }
}