| 1 | <?php |
||
| 5 | class Event extends \Symfony\Component\EventDispatcher\Event |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var mixed $target target object, on which event is fired |
||
| 9 | */ |
||
| 10 | private $_target; |
||
| 11 | |||
| 12 | private $_cancelled = false; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Set target object, on which event is fired |
||
| 16 | * @param mixed $target |
||
| 17 | * @return \Sokil\Mongo\Event |
||
| 18 | */ |
||
| 19 | public function setTarget($target) |
||
| 20 | { |
||
| 21 | $this->_target = $target; |
||
| 22 | return $this; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Get target object, on which event is fired |
||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | public function getTarget() |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Check if operation execution cancelled |
||
| 36 | */ |
||
| 37 | public function isCancelled() |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Cancel related operation execution. If called as beforeInsert |
||
| 44 | * handler, than insert will be cancelled. |
||
| 45 | */ |
||
| 46 | public function cancel() |
||
| 55 | } |