From 09d04a8a7ef9ff071bd632491ebeee4498a94e1d Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 10 Mar 2021 08:27:23 +0000 Subject: [PATCH] Add hub criteria object. #543 --- src/Ramcar/HubCriteria.php | 103 +++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/Ramcar/HubCriteria.php diff --git a/src/Ramcar/HubCriteria.php b/src/Ramcar/HubCriteria.php new file mode 100644 index 00000000..bc695dce --- /dev/null +++ b/src/Ramcar/HubCriteria.php @@ -0,0 +1,103 @@ +has_inventory = false; + $this->items = []; + } + + public function setPoint(Point $point) + { + $this->point = $point; + return $this; + } + + public function getPoint() + { + return $this->point; + } + + public function setLimitResults($limit_results) + { + $this->limit_results = $limit_results; + return $this; + } + + public function getLimitResults() + { + return $this->limit_results; + } + + public function setLimitDistance($limit_distance) + { + $this->limit_distance = $limit_distance; + return $this; + } + + public function getLimitDistance() + { + return $this->limit_distance; + } + + public function setHasInventory($has_inventory = true) + { + $this->has_inventory = $has_inventory; + return $this; + } + + public function hasInventory() + { + return $this->has_inventory; + } + + public function setJoType($jo_type) + { + // TODO: validate the jo type + $this->jo_type = $jo_type; + return $this; + } + + public function getJoType() + { + return $this->jo_type; + } + + public function setDayTime(DateTime $day_time) + { + $this->day_time = $day_time; + return $this; + } + + public function getDayTime() + { + return $this->day_time; + } + + public function addItem($id, $quantity) + { + // at this point, id is assumed to be a valid item + $this->items[$id] = $quantity; + return $this; + } + + public function getItems() + { + return $this->items; + } +}