You are here

class Messaging_User_Destination in Messaging 7

Destination is a system user

Hierarchy

Expanded class hierarchy of Messaging_User_Destination

1 string reference to 'Messaging_User_Destination'
messaging_messaging in ./messaging.module
Implements hook_messaging().

File

./messaging.destination.inc, line 425
Drupal Messaging Framework - Default class file

View source
class Messaging_User_Destination extends Messaging_Destination {
  public $type = 'user';
  public $address = '';

  /**
   * Get name for display
   */
  function address_name() {
    return t('User');
  }

  /**
   * Get address for sending
   */
  function get_address() {
    return $this
      ->get_user();
  }

  /**
   * Set user for this destination
   */
  function set_user($user) {
    $this->uid = $user->uid;
  }

  /**
   * Get unique index for this destination
   */
  function index() {
    return 'user:' . $this->uid;
  }

  /**
   * Get user from address
   */
  public static function get_user_from_address($address) {
    return $address;
  }

  /**
   * Get address from user
   */
  public static function get_address_from_user($user) {
    return $user;
  }

  /**
   * Check address is valid
   */
  public static function validate_address($address, $type = NULL) {
    return is_object($address) ? !empty($address->uid) : FALSE;
  }

  /**
   * Format address
   */
  public static function format_address($user, $format = MESSAGING_FORMAT_PLAIN, $type = NULL) {
    return $format & MESSAGING_FORMAT_HTML ? theme('username', array(
      'account' => $user,
    )) : check_plain($user->name);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Messaging_Destination::$mdid public property
Messaging_Destination::$name public property
Messaging_Destination::$sent public property
Messaging_Destination::$status public property
Messaging_Destination::$uid public property
Messaging_Destination::address_info function Get address type information
Messaging_Destination::build public static function Build destination object
Messaging_Destination::build_address public static function Build from address
Messaging_Destination::build_method public static function Build from method, address, user
Messaging_Destination::build_object public static function Build destination from db object Overrides Messaging_Object::build_object
Messaging_Destination::build_type public static function Build from address type
Messaging_Destination::build_user public static function Build from user account
Messaging_Destination::cache_by_address public static function Cache get/set by method and address
Messaging_Destination::cache_delete public function Save object to cache
Messaging_Destination::cache_get public static function
Messaging_Destination::cache_save public function Save object to cache
Messaging_Destination::cache_set public static function
Messaging_Destination::create public static function Create from array data
Messaging_Destination::create_method public static function Create for sending method
Messaging_Destination::create_type public static function Create with parameters
Messaging_Destination::delete_multiple public static function Delete messaging destination object/s
Messaging_Destination::format function Format destination
Messaging_Destination::get public static function Get from db using conditions
Messaging_Destination::get_by_address public static function Get destination by method and address. This allows advanced caching.
Messaging_Destination::get_name function Get address name (will be user name if available)
Messaging_Destination::get_title function Get address type name for display
Messaging_Destination::get_user function Get user account
Messaging_Destination::invoke_all protected function Run module_invoke_all('notifications_subscription') with this object
Messaging_Destination::load public static function Load object from database
Messaging_Destination::load_multiple public static function Load multiple events
Messaging_Destination::static_invoke protected static function Invoke static method on address type.
Messaging_Destination::STATUS_ACTIVE constant
Messaging_Destination::STATUS_PENDING constant
Messaging_Destination::validate_method public static function Validate values to create a destination
Messaging_Destination::validate_type public static function Validate values to create a destination
Messaging_Destination::__toString public function
Messaging_Object::__construct public function Constructor
Messaging_User_Destination::$address public property Overrides Messaging_Destination::$address
Messaging_User_Destination::$type public property Overrides Messaging_Destination::$type
Messaging_User_Destination::address_name function Get name for display
Messaging_User_Destination::format_address public static function Format address Overrides Messaging_Destination::format_address
Messaging_User_Destination::get_address function Get address for sending Overrides Messaging_Destination::get_address
Messaging_User_Destination::get_address_from_user public static function Get address from user Overrides Messaging_Destination::get_address_from_user
Messaging_User_Destination::get_user_from_address public static function Get user from address Overrides Messaging_Destination::get_user_from_address
Messaging_User_Destination::index function Get unique index for this destination Overrides Messaging_Destination::index
Messaging_User_Destination::set_user function Set user for this destination Overrides Messaging_Destination::set_user
Messaging_User_Destination::validate_address public static function Check address is valid Overrides Messaging_Destination::validate_address