Merge branch 'maint/7.0'
[ninja.git] / application / vendor / swiftmailer / classes / Swift / Events / EventObject.php
blob5d494fe898fa3673f91f8ea0cc60c48e02c543fe
1 <?php
3 /*
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.
9 */
11 //@require 'Swift/Events/Event.php';
13 /**
14 * A base Event which all Event classes inherit from.
16 * @package Swift
17 * @subpackage Events
18 * @author Chris Corbyn
20 class Swift_Events_EventObject implements Swift_Events_Event
23 /** The source of this Event */
24 private $_source;
26 /** The state of this Event (should it bubble up the stack?) */
27 private $_bubbleCancelled = false;
29 /**
30 * Create a new EventObject originating at $source.
31 * @param object $source
33 public function __construct($source)
35 $this->_source = $source;
38 /**
39 * Get the source object of this event.
40 * @return object
42 public function getSource()
44 return $this->_source;
47 /**
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;
56 /**
57 * Returns true if this Event will not bubble any further up the stack.
58 * @return boolean
60 public function bubbleCancelled()
62 return $this->_bubbleCancelled;