1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* |
4
|
|
|
* This file is part of Aura for PHP. |
5
|
|
|
* |
6
|
|
|
* @license http://opensource.org/licenses/bsd-license.php BSD |
7
|
|
|
* |
8
|
|
|
*/ |
9
|
|
|
namespace Aura\Filter\Exception; |
10
|
|
|
|
11
|
|
|
use Aura\Filter\Exception; |
12
|
|
|
use Aura\Filter\Failure\FailureCollection; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* |
16
|
|
|
* One or more filter rules failed. |
17
|
|
|
* |
18
|
|
|
* @package Aura.Filter |
19
|
|
|
* |
20
|
|
|
*/ |
21
|
|
|
class FilterFailed extends Exception |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* |
25
|
|
|
* Failures from the filter. |
26
|
|
|
* |
27
|
|
|
* @var FailureCollection |
28
|
|
|
* |
29
|
|
|
*/ |
30
|
|
|
protected $failures; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* |
34
|
|
|
* The subject being filtered. |
35
|
|
|
* |
36
|
|
|
* @var mixed |
37
|
|
|
* |
38
|
|
|
*/ |
39
|
|
|
protected $subject; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* |
43
|
|
|
* The class of the filter being applied. |
44
|
|
|
* |
45
|
|
|
* @var string |
46
|
|
|
* |
47
|
|
|
*/ |
48
|
|
|
protected $filter_class; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* |
52
|
|
|
* Sets the class of the filter being applied. |
53
|
|
|
* |
54
|
|
|
* @param string $filter_class The filter class. |
55
|
|
|
* |
56
|
|
|
* @return null |
57
|
|
|
* |
58
|
|
|
*/ |
59
|
1 |
|
public function setFilterClass($filter_class) |
60
|
|
|
{ |
61
|
1 |
|
$this->filter_class = $filter_class; |
62
|
1 |
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* |
66
|
|
|
* Gets the class of the filter being applied. |
67
|
|
|
* |
68
|
|
|
* @return string |
69
|
|
|
* |
70
|
|
|
*/ |
71
|
1 |
|
public function getFilterClass() |
72
|
|
|
{ |
73
|
1 |
|
return $this->filter_class; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* |
78
|
|
|
* Sets the failures from the filter. |
79
|
|
|
* |
80
|
|
|
* @param FailureCollection $failures The filter failures. |
81
|
|
|
* |
82
|
|
|
* @return null |
83
|
|
|
* |
84
|
|
|
*/ |
85
|
1 |
|
public function setFailures(FailureCollection $failures) |
86
|
|
|
{ |
87
|
1 |
|
$this->failures = $failures; |
88
|
1 |
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* |
92
|
|
|
* Gets the failures from the filter. |
93
|
|
|
* |
94
|
|
|
* @return FailureCollection |
95
|
|
|
* |
96
|
|
|
*/ |
97
|
1 |
|
public function getFailures() |
98
|
|
|
{ |
99
|
1 |
|
return $this->failures; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* |
104
|
|
|
* Sets the subject of the filter. |
105
|
|
|
* |
106
|
|
|
* @param mixed $subject The subject being filtered. |
107
|
|
|
* |
108
|
|
|
* @return null |
109
|
|
|
* |
110
|
|
|
*/ |
111
|
1 |
|
public function setSubject($subject) |
112
|
|
|
{ |
113
|
1 |
|
$this->subject = $subject; |
114
|
1 |
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* |
118
|
|
|
* Gets the subject of the filter. |
119
|
|
|
* |
120
|
|
|
* @return mixed |
121
|
|
|
* |
122
|
|
|
*/ |
123
|
1 |
|
public function getSubject() |
124
|
|
|
{ |
125
|
1 |
|
return $this->subject; |
126
|
|
|
} |
127
|
|
|
} |
128
|
|
|
|