[ Index ]

MailPress 544

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/Swiftmailer/classes/Swift/Plugins/ -> MessageLogger.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of SwiftMailer.
   5   * (c) 2011 Fabien Potencier
   6   *
   7   * For the full copyright and license information, please view the LICENSE
   8   * file that was distributed with this source code.
   9   */
  10  
  11  /**
  12   * Stores all sent emails for further usage.
  13   *
  14   * @author Fabien Potencier
  15   */
  16  class Swift_Plugins_MessageLogger implements Swift_Events_SendListener
  17  {
  18      /**
  19       * @var array
  20       */
  21      private $messages;
  22  
  23      public function __construct()
  24      {
  25          $this->messages = array();
  26      }
  27  
  28      /**
  29       * Get the message list.
  30       *
  31       * @return array
  32       */
  33      public function getMessages()
  34      {
  35          return $this->messages;
  36      }
  37  
  38      /**
  39       * Get the message count.
  40       *
  41       * @return int count
  42       */
  43      public function countMessages()
  44      {
  45          return count($this->messages);
  46      }
  47  
  48      /**
  49       * Empty the message list.
  50       */
  51      public function clear()
  52      {
  53          $this->messages = array();
  54      }
  55  
  56      /**
  57       * Invoked immediately before the Message is sent.
  58       *
  59       * @param Swift_Events_SendEvent $evt
  60       */
  61      public function beforeSendPerformed(Swift_Events_SendEvent $evt)
  62      {
  63          $this->messages[] = clone $evt->getMessage();
  64      }
  65  
  66      /**
  67       * Invoked immediately after the Message is sent.
  68       *
  69       * @param Swift_Events_SendEvent $evt
  70       */
  71      public function sendPerformed(Swift_Events_SendEvent $evt)
  72      {
  73      }
  74  }


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1