1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ubiquity\contents\validation\validators; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Constraint Violation Generated During Validation with the ValidatorsManager |
7
|
|
|
* |
8
|
|
|
* Ubiquity\contents\validation\validators$ConstraintViolation |
9
|
|
|
* This class is part of Ubiquity |
10
|
|
|
* |
11
|
|
|
* @author jcheron <[email protected]> |
12
|
|
|
* @version 1.0.0 |
13
|
|
|
* |
14
|
|
|
*/ |
15
|
|
|
class ConstraintViolation { |
16
|
|
|
protected $message; |
17
|
|
|
protected $value; |
18
|
|
|
protected $member; |
19
|
|
|
protected $validatorType; |
20
|
|
|
protected $severity; |
21
|
|
|
|
22
|
3 |
|
public function __construct($message, $value, $member, $validatorType, $severity) { |
23
|
3 |
|
$this->message = $message; |
24
|
3 |
|
$this->severity = $severity; |
25
|
3 |
|
$this->value = $value; |
26
|
3 |
|
$this->member = $member; |
27
|
3 |
|
$this->validatorType = $validatorType; |
28
|
3 |
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* |
32
|
|
|
* @return mixed |
33
|
|
|
*/ |
34
|
2 |
|
public function getMessage() { |
35
|
2 |
|
return $this->message; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* |
40
|
|
|
* @return mixed |
41
|
|
|
*/ |
42
|
1 |
|
public function getValue() { |
43
|
1 |
|
return $this->value; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* |
48
|
|
|
* @return mixed |
49
|
|
|
*/ |
50
|
1 |
|
public function getMember() { |
51
|
1 |
|
return $this->member; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* |
56
|
|
|
* @return mixed |
57
|
|
|
*/ |
58
|
2 |
|
public function getValidatorType() { |
59
|
2 |
|
return $this->validatorType; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* |
64
|
|
|
* @return mixed |
65
|
|
|
*/ |
66
|
1 |
|
public function getSeverity() { |
67
|
1 |
|
return $this->severity; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* |
72
|
|
|
* @param mixed $message |
73
|
|
|
*/ |
74
|
|
|
public function setMessage($message) { |
75
|
|
|
$this->message = $message; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* |
80
|
|
|
* @param mixed $value |
81
|
|
|
*/ |
82
|
|
|
public function setValue($value) { |
83
|
|
|
$this->value = $value; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* |
88
|
|
|
* @param mixed $member |
89
|
|
|
*/ |
90
|
|
|
public function setMember($member) { |
91
|
|
|
$this->member = $member; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* |
96
|
|
|
* @param mixed $validatorType |
97
|
|
|
*/ |
98
|
|
|
public function setValidatorType($validatorType) { |
99
|
|
|
$this->validatorType = $validatorType; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* |
104
|
|
|
* @param mixed $severity |
105
|
|
|
*/ |
106
|
|
|
public function setSeverity($severity) { |
107
|
|
|
$this->severity = $severity; |
108
|
|
|
} |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
|