1 | <?php |
||
9 | trait ManageLastModifiedHeader |
||
10 | { |
||
11 | /** |
||
12 | * Last modified header value. |
||
13 | * |
||
14 | * @var \Carbon\Carbon|null |
||
15 | */ |
||
16 | protected $lastModified = null; |
||
17 | |||
18 | /** |
||
19 | * Add Last-Modified header to the current response. |
||
20 | * |
||
21 | * @param \Symfony\Component\HttpFoundation\Response $response |
||
22 | * |
||
23 | * @return void |
||
24 | */ |
||
25 | protected function addLastModifiedHeader(Response $response): void |
||
33 | |||
34 | /** |
||
35 | * Disable Last-Modified header for the current response. |
||
36 | * |
||
37 | * @return void |
||
38 | */ |
||
39 | public function disableLastModified(): void |
||
43 | |||
44 | /** |
||
45 | * Enable Last-Modified header for the current response. |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | public function enableLastModified(): void |
||
53 | |||
54 | /** |
||
55 | * Get last modified header for the current response. |
||
56 | * |
||
57 | * @return \Carbon\Carbon|null |
||
58 | */ |
||
59 | public function getLastModifiedHeader(): ?Carbon |
||
63 | |||
64 | /** |
||
65 | * Set last modified header for the current response. |
||
66 | * |
||
67 | * @param \Carbon\Carbon|string $current |
||
68 | * |
||
69 | * @throws Exception |
||
70 | * |
||
71 | * @return void |
||
72 | */ |
||
73 | public function setLastModifiedHeader($current): void |
||
83 | |||
84 | /** |
||
85 | * Get configuration value for a specific key. |
||
86 | * |
||
87 | * @param string $key |
||
88 | * |
||
89 | * @return mixed |
||
90 | */ |
||
91 | abstract public function getConfig($key); |
||
92 | |||
93 | /** |
||
94 | * Set configuration value for a specific key. |
||
95 | * |
||
96 | * @param string $key |
||
97 | * @param mixed $value |
||
98 | * |
||
99 | * @return void |
||
100 | */ |
||
101 | abstract public function setConfig($key, $value): void; |
||
102 | } |
||
103 |