summaryrefslogtreecommitdiff
path: root/src/Model/Vendor.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2018-04-29 22:24:25 +0100
committerFbenas <philbeansburton@gmail.com>2018-04-29 22:24:25 +0100
commitc223ab602cbe7f6db7321ba547164971d63d7bcd (patch)
treea4a73aab1d8082b2f96f899fc4d51040fe5ed85e /src/Model/Vendor.php
parentaf0cd60fc5fd2939477dfccd4c0e78892e76d5ba (diff)
WIP
Diffstat (limited to 'src/Model/Vendor.php')
-rw-r--r--src/Model/Vendor.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/Model/Vendor.php b/src/Model/Vendor.php
new file mode 100644
index 0000000..99a95dd
--- /dev/null
+++ b/src/Model/Vendor.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Model;
+
+use App\File\Handler as FileHandler;
+use App\Model\Collection;
+use App\Model\Model;
+use App\Script\Input;
+
+/**
+ * Vendor Model
+ */
+class Vendor extends Model
+{
+ protected $name;
+ protected $postcode;
+ protected $maxCovers;
+ protected $menus;
+
+ /**
+ * Load vendors from file, parse them into a model collection and Return
+ *
+ * @author Phil Burton <phil@pgburton.com>
+ * @param FileHandler $handler
+ * @return Collection
+ */
+ public function loadFromFile(FileHandler $handler): Collection
+ {
+ // initalise a Vendor Collection
+ $collection = new Collection;
+
+ foreach ($handler->getVendorArray() as $vendorRaw) {
+ $collection[] = new Vendor($vendorRaw);
+ }
+
+ return $collection;
+ }
+
+ /**
+ * Filter by input
+ *
+ * @author Phil Burton <phil@pgburton.com>
+ * @param Input $input
+ */
+ public function filterByInput(Input $input)
+ {
+ // Amend the colletion so we've filtered by the input
+ }
+}