1 | <?php |
||
20 | class Errors |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * The system settings |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $settings = array(); |
||
29 | |||
30 | /** |
||
31 | * Contains an array of the errors found |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $errors = array(); |
||
36 | |||
37 | /** |
||
38 | * The Validation object |
||
39 | * |
||
40 | * @var \JaegerApp\Validate |
||
41 | */ |
||
42 | protected $validation = null; |
||
43 | |||
44 | /** |
||
45 | * Returns the total number of errors |
||
46 | * |
||
47 | * @return int |
||
48 | */ |
||
49 | public function totalErrors() |
||
53 | |||
54 | /** |
||
55 | * Returns just a single error |
||
56 | * |
||
57 | * @return mixed |
||
58 | */ |
||
59 | public function getError() |
||
64 | |||
65 | /** |
||
66 | * Returns all the errors found |
||
67 | * |
||
68 | * @return array |
||
69 | */ |
||
70 | public function getErrors() |
||
74 | |||
75 | /** |
||
76 | * Sets the settings to check |
||
77 | * |
||
78 | * @param array $settings |
||
79 | * @return \JaegerApp\Errors |
||
80 | */ |
||
81 | public function setSettings(array $settings) |
||
86 | |||
87 | /** |
||
88 | * Returns the set settings array |
||
89 | * |
||
90 | * @return array |
||
91 | */ |
||
92 | public function getSettings() |
||
96 | |||
97 | /** |
||
98 | * Clears out any errors that were added |
||
99 | * |
||
100 | * @return \JaegerApp\Errors |
||
101 | */ |
||
102 | public function clearErrors() |
||
107 | |||
108 | /** |
||
109 | * Sets the Validation object |
||
110 | * |
||
111 | * @param \JaegerApp\Validate $val |
||
112 | * @return \JaegerApp\Errors |
||
113 | */ |
||
114 | public function setValidation(\JaegerApp\Validate $val) |
||
119 | |||
120 | /** |
||
121 | * Returns an instance of the validation object |
||
122 | * |
||
123 | * @return \JaegerApp\Validate |
||
124 | */ |
||
125 | public function getValidation() |
||
129 | |||
130 | /** |
||
131 | * Sets an error |
||
132 | * |
||
133 | * @param string $name |
||
134 | * The key the error will be placed at in the error array |
||
135 | * @param string $error |
||
136 | * The error message language key |
||
137 | */ |
||
138 | public function setError($name, $error) |
||
142 | |||
143 | /** |
||
144 | * Verifies the license key is valid |
||
145 | * |
||
146 | * @param string $license_key |
||
147 | * @param \JaegerApp\License $license |
||
148 | * @return \JaegerApp\Errors |
||
149 | */ |
||
150 | public function licenseCheck($license_key, \JaegerApp\License $license) |
||
162 | } |