1 | <?php |
||
7 | abstract class Operation |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $code; |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $reason; |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $target; |
||
21 | |||
22 | /** |
||
23 | * @return string |
||
24 | */ |
||
25 | 25 | public function getCode() |
|
26 | { |
||
27 | 25 | return $this->code; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param string $code |
||
32 | * @return $this |
||
33 | */ |
||
34 | public function setCode($code) |
||
35 | { |
||
36 | $this->code = $code; |
||
37 | |||
38 | return $this; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return int |
||
43 | */ |
||
44 | 111 | public function getLevel() |
|
45 | { |
||
46 | 111 | return LevelMapping::getLevelForCode($this->getCode()); |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | 22 | public function getReason() |
|
53 | { |
||
54 | 22 | return $this->reason; |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * @param string $reason |
||
59 | * @return $this |
||
60 | */ |
||
61 | public function setReason($reason) |
||
62 | { |
||
63 | $this->reason = $reason; |
||
64 | |||
65 | return $this; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | public abstract function getLocation(); |
||
72 | |||
73 | /** |
||
74 | * @return int |
||
75 | */ |
||
76 | public abstract function getLine(); |
||
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getTarget() |
||
82 | { |
||
83 | return $this->target; |
||
85 | |||
86 | /** |
||
87 | * @param string $target |
||
88 | * @return $this |
||
89 | */ |
||
90 | public function setTarget($target) |
||
96 | } |
||
97 |