Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * Pop PHP Framework (http://www.popphp.org/) |
4 | * |
5 | * @link https://github.com/popphp/popphp-framework |
6 | * @author Nick Sagona, III <dev@nolainteractive.com> |
7 | * @copyright Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
8 | * @license http://www.popphp.org/license New BSD License |
9 | */ |
10 | |
11 | /** |
12 | * @namespace |
13 | */ |
14 | namespace Pop\Audit\Adapter; |
15 | |
16 | /** |
17 | * Auditor adapter interface |
18 | * |
19 | * @category Pop |
20 | * @package Pop\Audit |
21 | * @author Nick Sagona, III <dev@nolainteractive.com> |
22 | * @copyright Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com) |
23 | * @license http://www.popphp.org/license New BSD License |
24 | * @version 1.3.0 |
25 | */ |
26 | interface AdapterInterface |
27 | { |
28 | |
29 | /** |
30 | * Set the model name |
31 | * |
32 | * @param string $model |
33 | * @return self |
34 | */ |
35 | public function setModel($model); |
36 | |
37 | /** |
38 | * Set the model ID |
39 | * |
40 | * @param int $modelId |
41 | * @return self |
42 | */ |
43 | public function setModelId($modelId); |
44 | |
45 | /** |
46 | * Get the model name |
47 | * |
48 | * @return string |
49 | */ |
50 | public function getModel(); |
51 | |
52 | /** |
53 | * Get the model ID |
54 | * |
55 | * @return int |
56 | */ |
57 | public function getModelId(); |
58 | |
59 | /** |
60 | * Get the action |
61 | * |
62 | * @return string |
63 | */ |
64 | public function getAction(); |
65 | |
66 | /** |
67 | * Get the original model state differences |
68 | * |
69 | * @return array |
70 | */ |
71 | public function getOriginal(); |
72 | |
73 | /** |
74 | * Get the modified model state differences |
75 | * |
76 | * @return array |
77 | */ |
78 | public function getModified(); |
79 | |
80 | /** |
81 | * Set the username |
82 | * |
83 | * @param string $username |
84 | * @return self |
85 | */ |
86 | public function setUsername($username); |
87 | |
88 | /** |
89 | * Set the user ID |
90 | * |
91 | * @param int $userId |
92 | * @return self |
93 | */ |
94 | public function setUserId($userId); |
95 | |
96 | /** |
97 | * Set the domain |
98 | * |
99 | * @param string $domain |
100 | * @return self |
101 | */ |
102 | public function setDomain($domain); |
103 | |
104 | /** |
105 | * Set the route |
106 | * |
107 | * @param string $route |
108 | * @return self |
109 | */ |
110 | public function setRoute($route); |
111 | |
112 | /** |
113 | * Set the method |
114 | * |
115 | * @param string $method |
116 | * @return self |
117 | */ |
118 | public function setMethod($method); |
119 | |
120 | /** |
121 | * Set the metadata |
122 | * |
123 | * @param array $metadata |
124 | * @return self |
125 | */ |
126 | public function setMetadata(array $metadata); |
127 | |
128 | /** |
129 | * Add to the metadata |
130 | * |
131 | * @param string $name |
132 | * @param mixed $value |
133 | * @return self |
134 | */ |
135 | public function addMetadata($name, $value); |
136 | |
137 | /** |
138 | * Get the username |
139 | * |
140 | * @return string |
141 | */ |
142 | public function getUsername(); |
143 | |
144 | /** |
145 | * Get the user ID |
146 | * |
147 | * @return int |
148 | */ |
149 | public function getUserId(); |
150 | |
151 | /** |
152 | * Get the domain |
153 | * |
154 | * @return string |
155 | */ |
156 | public function getDomain(); |
157 | |
158 | /** |
159 | * Get the route |
160 | * |
161 | * @return string |
162 | */ |
163 | public function getRoute(); |
164 | |
165 | /** |
166 | * Get the method |
167 | * |
168 | * @return string |
169 | */ |
170 | public function getMethod(); |
171 | |
172 | /** |
173 | * Determine if there is metadata |
174 | * |
175 | * @param string $name |
176 | * @return boolean |
177 | */ |
178 | public function hasMetadata($name = null); |
179 | |
180 | /** |
181 | * Get the metadata |
182 | * |
183 | * @param string $name |
184 | * @return mixed |
185 | */ |
186 | public function getMetadata($name = null); |
187 | |
188 | /** |
189 | * Set the differences in values between the model states (that have already been processed) |
190 | * |
191 | * @param array $old |
192 | * @param array $new |
193 | * @return self |
194 | */ |
195 | public function setDiff(array $old, array $new); |
196 | |
197 | /** |
198 | * Resolve the differences in values between the model states |
199 | * |
200 | * @param array $old |
201 | * @param array $new |
202 | * @return self |
203 | */ |
204 | public function resolveDiff(array $old, array $new); |
205 | |
206 | /** |
207 | * Check if the model states are different |
208 | * |
209 | * @return boolean |
210 | */ |
211 | public function hasDiff(); |
212 | |
213 | /** |
214 | * Prepare data |
215 | * |
216 | * @param boolean $jsonEncode |
217 | * @return array |
218 | */ |
219 | public function prepareData($jsonEncode = true); |
220 | |
221 | /** |
222 | * Send the results of the audit |
223 | * |
224 | * @return mixed |
225 | */ |
226 | public function send(); |
227 | |
228 | /** |
229 | * Get model states |
230 | * |
231 | * @return array |
232 | */ |
233 | public function getStates(); |
234 | |
235 | /** |
236 | * Get model state by ID |
237 | * |
238 | * @param int $id |
239 | * @return array |
240 | */ |
241 | public function getStateById($id); |
242 | |
243 | /** |
244 | * Get model state by model |
245 | * |
246 | * @param string $model |
247 | * @param int $modelId |
248 | * @return array |
249 | */ |
250 | public function getStateByModel($model, $modelId = null); |
251 | |
252 | /** |
253 | * Get model state by timestamp |
254 | * |
255 | * @param string $from |
256 | * @param string $backTo |
257 | * @return array |
258 | */ |
259 | public function getStateByTimestamp($from, $backTo = null); |
260 | |
261 | /** |
262 | * Get model state by date |
263 | * |
264 | * @param string $from |
265 | * @param string $backTo |
266 | * @return array |
267 | */ |
268 | public function getStateByDate($from, $backTo = null); |
269 | |
270 | /** |
271 | * Get model snapshot by ID |
272 | * |
273 | * @param int $id |
274 | * @param boolean $post |
275 | * @return array |
276 | */ |
277 | public function getSnapshot($id, $post = false); |
278 | |
279 | } |