1: <?php
2:
3: /**
4: * This file contains several exception classes.
5: *
6: * @package Plugin
7: * @subpackage FormAssistant
8: * @author Marcus Gnaß <marcus.gnass@4fb.de>
9: * @copyright four for business AG
10: * @link http://www.4fb.de
11: */
12:
13: // assert CONTENIDO framework
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15:
16: /**
17: * Base class for all PIFA related exceptions.
18: *
19: * @author Marcus Gnaß <marcus.gnass@4fb.de>
20: */
21: class PifaException extends cException
22: {
23: }
24:
25: /**
26: * Exceptions indicating a problem when PIFA tries to access the database.
27: *
28: * @author Marcus Gnaß <marcus.gnass@4fb.de>
29: */
30: class PifaDatabaseException extends PifaException
31: {
32: }
33:
34: /**
35: * Exceptions indicating that a certain PIFA feature is not yet implemented.
36: *
37: * @author Marcus Gnaß <marcus.gnass@4fb.de>
38: */
39: class PifaNotImplementedException extends PifaException
40: {
41: }
42:
43: /**
44: * Exceptions indicating that PIFA reached an illegal state.
45: * This happens e.g. if permissions for a certain action are missing.
46: *
47: * @author Marcus Gnaß <marcus.gnass@4fb.de>
48: */
49: class PifaIllegalStateException extends PifaException
50: {
51: }
52:
53: /**
54: * Currently not in use.
55: *
56: * @author Marcus Gnaß <marcus.gnass@4fb.de>
57: */
58: class PifaNotYetStoredException extends PifaException
59: {
60: }
61:
62: /**
63: * Exceptions indicating that invalid data was found when PIFA tried to process
64: * posted data.
65: *
66: * @author Marcus Gnaß <marcus.gnass@4fb.de>
67: */
68: class PifaValidationException extends PifaException
69: {
70: /**
71: * @var array
72: */
73: private $_errors = [];
74:
75: /**
76: * @param array $errors
77: */
78: public function __construct(array $errors)
79: {
80: // parent::__construct($message, $code, $previous);
81: $this->_errors = $errors;
82: }
83:
84: /**
85: * @return array
86: */
87: public function getErrors()
88: {
89: return $this->_errors;
90: }
91: }
92:
93: /**
94: * Exceptions indicating a problem when PIFA tries to send a mail.
95: *
96: * @author Marcus Gnaß <marcus.gnass@4fb.de>
97: */
98: class PifaMailException extends PifaException
99: {
100: }
101: