From e041623e9df4ed487ce3823abd26a70d6a079228 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Tue, 16 Jan 2018 03:16:07 +0800 Subject: [PATCH] Add constants for job order status and job order service type --- src/Ramcar/JOStatus.php | 34 ++++++++++++++++++++++++++++++++++ src/Ramcar/ServiceType.php | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/Ramcar/JOStatus.php diff --git a/src/Ramcar/JOStatus.php b/src/Ramcar/JOStatus.php new file mode 100644 index 00000000..15c64f67 --- /dev/null +++ b/src/Ramcar/JOStatus.php @@ -0,0 +1,34 @@ + 'pending'; + const ASSIGNED => 'assigned'; + const IN_PROGRESS => 'in_progress'; + const CANCELLED => 'cancelled'; + const FULFILLED => 'fulfilled'; + + const COLLECTION = [ + 'pending' => 'Pending', + 'assigned' => 'Assigned', + 'in_progress' => 'In Progress', + 'cancelled' => 'Cancelled', + 'fulfilled' => 'Fulfilled', + ]; + + static public function getCollection() + { + return self::COLLECTION; + } + + static public function validate($type_text) + { + if (isset(self::COLLECTION[$type_text])) + return true; + + return false; + } + +} diff --git a/src/Ramcar/ServiceType.php b/src/Ramcar/ServiceType.php index 54d83a5e..0eb92229 100644 --- a/src/Ramcar/ServiceType.php +++ b/src/Ramcar/ServiceType.php @@ -17,7 +17,7 @@ class ServiceType ]; - static public function getServiceTypes() + static public function getCollection() { return self::COLLECTION; }