4 * This file is part of SwiftMailer.
5 * (c) 2004-2009 Chris Corbyn
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 //@require 'Swift/Events/Event.php';
14 * A base Event which all Event classes inherit from.
18 * @author Chris Corbyn
20 class Swift_Events_EventObject
implements Swift_Events_Event
23 /** The source of this Event */
26 /** The state of this Event (should it bubble up the stack?) */
27 private $_bubbleCancelled = false;
30 * Create a new EventObject originating at $source.
31 * @param object $source
33 public function __construct($source)
35 $this->_source
= $source;
39 * Get the source object of this event.
42 public function getSource()
44 return $this->_source
;
48 * Prevent this Event from bubbling any further up the stack.
49 * @param boolean $cancel, optional
51 public function cancelBubble($cancel = true)
53 $this->_bubbleCancelled
= $cancel;
57 * Returns true if this Event will not bubble any further up the stack.
60 public function bubbleCancelled()
62 return $this->_bubbleCancelled
;