1 | <?php |
||
28 | class IncidentRecord extends Record |
||
29 | { |
||
30 | use TimestampsTrait; |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | const DATABASE = 'snapshots'; |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | const SCHEMA = [ |
||
41 | //primary fields |
||
42 | 'id' => 'primary', |
||
43 | 'status' => IncidentStatus::class, |
||
44 | |||
45 | //exception fields |
||
46 | 'exception_hash' => 'string', |
||
47 | 'exception_source' => 'longText, nullable', |
||
48 | 'exception_teaser' => 'string', |
||
49 | 'exception_classname' => 'string', |
||
50 | 'exception_message' => 'string', |
||
51 | 'exception_line' => 'int', |
||
52 | 'exception_file' => 'string', |
||
53 | 'exception_code' => 'int', |
||
54 | ]; |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | const SECURED = [ |
||
60 | 'exception_source', //should be passed via gzencode setter |
||
61 | ]; |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | const INDEXES = [ |
||
67 | [self::INDEX, 'exception_hash'], |
||
68 | ]; |
||
69 | |||
70 | /** |
||
71 | * Suppress incident. Set according status and clean source. |
||
72 | */ |
||
73 | public function suppress() |
||
78 | |||
79 | /** |
||
80 | * Delete override. |
||
81 | */ |
||
82 | public function delete() |
||
88 | |||
89 | /** |
||
90 | * @return null|string |
||
91 | */ |
||
92 | public function getExceptionSource() |
||
101 | |||
102 | /** |
||
103 | * @param string $source |
||
104 | */ |
||
105 | public function setExceptionSource(string $source) |
||
109 | |||
110 | /** |
||
111 | * @return int |
||
112 | */ |
||
113 | public function getExceptionCode(): int |
||
117 | |||
118 | /** |
||
119 | * @return string |
||
120 | */ |
||
121 | public function getExceptionHash(): string |
||
125 | |||
126 | /** |
||
127 | * @return string |
||
128 | */ |
||
129 | public function getExceptionTeaser(): string |
||
133 | |||
134 | /** |
||
135 | * @return string |
||
136 | */ |
||
137 | public function getExceptionClass(): string |
||
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getExceptionMessage(): string |
||
149 | |||
150 | /** |
||
151 | * @return int |
||
152 | */ |
||
153 | public function getExceptionLine(): int |
||
157 | |||
158 | /** |
||
159 | * @return string |
||
160 | */ |
||
161 | public function getExceptionFile(): string |
||
165 | } |