summaryrefslogtreecommitdiff
path: root/src/DTS/Old.php
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2021-11-13 09:22:25 +0000
committerDavid T. Sadler <davidtsadler@googlemail.com>2021-11-13 09:22:25 +0000
commit40997195b7ee07cb1bda978186c1804371e1f16e (patch)
tree17a6e4bd6eaca795cfa8d57b9aa6ea8ad7066593 /src/DTS/Old.php
parent35dc6c245d93560d7ac81df6323e8b22e571aa95 (diff)
Create site
Diffstat (limited to 'src/DTS/Old.php')
-rw-r--r--src/DTS/Old.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/DTS/Old.php b/src/DTS/Old.php
new file mode 100644
index 0000000..0641329
--- /dev/null
+++ b/src/DTS/Old.php
@@ -0,0 +1,29 @@
+<?php
+
+declare(strict_types=1);
+
+namespace DTS;
+
+class Old
+{
+ const FIELDS = [
+ 'task',
+ 'tag',
+ ];
+
+ private array $old = [];
+
+ function __construct(array $request = [])
+ {
+ foreach(self::FIELDS as $field) {
+ if (array_key_exists($field, $request)) {
+ $this->old[$field] = $request[$field];
+ }
+ }
+ }
+
+ public function get(string $key, $default = null)
+ {
+ return $this->old[$key] ?? $default;
+ }
+}