[ Index ]

MailPress 544

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

title

Body

[close]

/mp-includes/Swiftmailer/classes/Swift/Events/ -> EventObject.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of SwiftMailer.
   5   * (c) 2004-2009 Chris Corbyn
   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   * A base Event which all Event classes inherit from.
  13   *
  14   * @author Chris Corbyn
  15   */
  16  class Swift_Events_EventObject implements Swift_Events_Event
  17  {
  18      /** The source of this Event */
  19      private $_source;
  20  
  21      /** The state of this Event (should it bubble up the stack?) */
  22      private $_bubbleCancelled = false;
  23  
  24      /**
  25       * Create a new EventObject originating at $source.
  26       *
  27       * @param object $source
  28       */
  29      public function __construct($source)
  30      {
  31          $this->_source = $source;
  32      }
  33  
  34      /**
  35       * Get the source object of this event.
  36       *
  37       * @return object
  38       */
  39      public function getSource()
  40      {
  41          return $this->_source;
  42      }
  43  
  44      /**
  45       * Prevent this Event from bubbling any further up the stack.
  46       *
  47       * @param bool $cancel, optional
  48       */
  49      public function cancelBubble($cancel = true)
  50      {
  51          $this->_bubbleCancelled = $cancel;
  52      }
  53  
  54      /**
  55       * Returns true if this Event will not bubble any further up the stack.
  56       *
  57       * @return bool
  58       */
  59      public function bubbleCancelled()
  60      {
  61          return $this->_bubbleCancelled;
  62      }
  63  }


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