You are here

class MessageExampleArguments in Message 7

@file Contains EntityValidatorExampleArticleValidator.

Hierarchy

Expanded class hierarchy of MessageExampleArguments

1 string reference to 'MessageExampleArguments'
example_arguments.inc in message_example/plugins/computed_arguments/example_arguments/example_arguments.inc

File

message_example/plugins/computed_arguments/example_arguments/MessageExampleArguments.class.php, line 8
Contains EntityValidatorExampleArticleValidator.

View source
class MessageExampleArguments extends MessageArgumentsBase {

  /**
   * @return mixed
   */
  public function getNameArgument() {
    return array(
      '@name' => array(
        $this,
        'processName',
      ),
      '%time' => array(
        $this,
        'processTime',
      ),
      '!link' => array(
        $this,
        'processLink',
      ),
    );
  }

  /**
   * Private function for the getting the user object.
   *
   * @return \stdClass.
   *   The user object.
   */
  private function getAccount() {
    return $this
      ->getMessage()
      ->user();
  }

  /**
   * Process the user current user name.
   */
  public function processName() {
    return $this
      ->getAccount()->name;
  }

  /**
   * Process the current time.
   */
  public function processTime() {
    return format_date($this
      ->getMessage()->timestamp);
  }

  /**
   * Process the link the user profile.
   */
  public function processLink() {
    $uri = entity_uri('user', $this
      ->getAccount());
    return l(t('link'), $uri['path'], array(
      'absolute' => TRUE,
    ));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MessageArgumentsBase::$message protected property The message object.
MessageArgumentsBase::getArguments public function Retrieve the arguments info. Overrides MessageArgumentInterface::getArguments
MessageArgumentsBase::getMessage public function Overrides MessageArgumentInterface::getMessage
MessageArgumentsBase::setMessage public function Overrides MessageArgumentInterface::setMessage
MessageExampleArguments::getAccount private function Private function for the getting the user object.
MessageExampleArguments::getNameArgument public function Overrides MessageArgumentInterface::getNameArgument
MessageExampleArguments::processLink public function Process the link the user profile.
MessageExampleArguments::processName public function Process the user current user name.
MessageExampleArguments::processTime public function Process the current time.