1 | <?php |
||
29 | class IncidentRecord extends Record |
||
30 | { |
||
31 | use TimestampsTrait; |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | const DATABASE = 'snapshots'; |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | const SCHEMA = [ |
||
42 | //primary fields |
||
43 | 'id' => 'primary', |
||
44 | 'status' => IncidentStatus::class, |
||
45 | |||
46 | //exception fields |
||
47 | 'exception_hash' => 'string(128)', |
||
48 | 'exception_source' => 'longBinary, nullable', |
||
49 | 'exception_teaser' => 'string', |
||
50 | 'exception_classname' => 'string', |
||
51 | 'exception_message' => 'string', |
||
52 | 'exception_line' => 'int', |
||
53 | 'exception_file' => 'string', |
||
54 | 'exception_code' => 'int', |
||
55 | ]; |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | const SECURED = [ |
||
61 | 'exception_source', //should be passed via gzencode setter |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | const INDEXES = [ |
||
68 | [self::INDEX, 'exception_hash'], |
||
69 | [self::INDEX, 'exception_hash', 'status'], |
||
70 | ]; |
||
71 | |||
72 | /** |
||
73 | * Suppress incident. Set according status and clean source. |
||
74 | */ |
||
75 | public function suppress() |
||
80 | |||
81 | /** |
||
82 | * {@inheritDoc} |
||
83 | */ |
||
84 | public function delete(TransactionInterface $transaction = null) |
||
90 | |||
91 | /** |
||
92 | * @return null|string |
||
93 | */ |
||
94 | public function getExceptionSource() |
||
103 | |||
104 | /** |
||
105 | * @param string $source |
||
106 | */ |
||
107 | public function setExceptionSource(string $source) |
||
111 | |||
112 | /** |
||
113 | * @return int |
||
114 | */ |
||
115 | public function getExceptionCode(): int |
||
119 | |||
120 | /** |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getExceptionHash(): string |
||
127 | |||
128 | /** |
||
129 | * @return string |
||
130 | */ |
||
131 | public function getExceptionTeaser(): string |
||
135 | |||
136 | /** |
||
137 | * @return string |
||
138 | */ |
||
139 | public function getExceptionClass(): string |
||
143 | |||
144 | /** |
||
145 | * @return string |
||
146 | */ |
||
147 | public function getExceptionMessage(): string |
||
151 | |||
152 | /** |
||
153 | * @return int |
||
154 | */ |
||
155 | public function getExceptionLine(): int |
||
159 | |||
160 | /** |
||
161 | * @return string |
||
162 | */ |
||
163 | public function getExceptionFile(): string |
||
167 | } |