You are here

class Messaging_Simple_Method in Messaging 7

Web sending method

Hierarchy

Expanded class hierarchy of Messaging_Simple_Method

1 string reference to 'Messaging_Simple_Method'
messaging_simple_messaging in messaging_simple/messaging_simple.module
Implementation of hook_messaging

File

messaging_simple/messaging_simple.inc, line 74
Drupal Messaging Framework - Send_Method class file

View source
class Messaging_Simple_Method extends Messaging_Send_Method {

  // Default group and address type
  public $method = 'simple';
  public $type = 'web';
  public $anonymous = FALSE;
  public $format = MESSAGING_FORMAT_HTML;

  /**
   * Get address type
   */
  public static function address_type() {
    return 'user';
  }

  /**
   * It doesn't support anonymous destinations
   */
  function supports_anonymous() {
    return FALSE;
  }

  /**
   * Send message to address, use sending callback
   */
  function send_address($user, $message) {
    return $this
      ->send_user($user, $message);
  }

  /**
   * Send to user. Just store the message to be shown later.
   */
  function send_user($user, $message) {
    $user = messaging_user_object($user);
    $simple = Messaging_Simple::build($user, $message);
    return (bool) $simple
      ->save();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Messaging_Simple_Method::$anonymous public property
Messaging_Simple_Method::$format public property
Messaging_Simple_Method::$method public property
Messaging_Simple_Method::$type public property
Messaging_Simple_Method::address_type public static function Get address type
Messaging_Simple_Method::send_address function Send message to address, use sending callback
Messaging_Simple_Method::send_user function Send to user. Just store the message to be shown later.
Messaging_Simple_Method::supports_anonymous function It doesn't support anonymous destinations