1: <?php
2:
3: /**
4: * Jyxo PHP Library
5: *
6: * LICENSE
7: *
8: * This source file is subject to the new BSD license that is bundled
9: * with this package in the file license.txt.
10: * It is also available through the world-wide-web at this URL:
11: * https://github.com/jyxo/php/blob/master/license.txt
12: */
13:
14: namespace Jyxo;
15:
16: /**
17: * Base exception class used throughout Jyxo libraries.
18: *
19: * @category Jyxo
20: * @package Jyxo\ErrorHandling
21: * @copyright Copyright (c) 2005-2011 Jyxo, s.r.o.
22: * @license https://github.com/jyxo/php/blob/master/license.txt
23: * @author Jaroslav HanslĂk
24: */
25: class Exception extends \Exception
26: {
27: /**
28: * Returns all previous exceptions in an array.
29: *
30: * @return array
31: */
32: public function getAllPrevious()
33: {
34: $stack = array();
35: $previous = $this->getPrevious();
36: while (null !== $previous) {
37: $stack[] = $previous;
38: $previous = $previous->getPrevious();
39: }
40: return $stack;
41: }
42: }
43: