From e62045e8d4ed36628739b353cab592de4c40d7cf Mon Sep 17 00:00:00 2001 From: karneaud Date: Sun, 23 Jun 2024 22:31:03 -0400 Subject: [PATCH] add data providers for privinces and installment --- app/DataProviders/CAProvinces.php | 55 +++++++++++++++++++++++++++++++ app/DataProviders/Frequencies.php | 19 +++++++++++ 2 files changed, 74 insertions(+) create mode 100644 app/DataProviders/CAProvinces.php create mode 100644 app/DataProviders/Frequencies.php diff --git a/app/DataProviders/CAProvinces.php b/app/DataProviders/CAProvinces.php new file mode 100644 index 0000000000..251f6e7c92 --- /dev/null +++ b/app/DataProviders/CAProvinces.php @@ -0,0 +1,55 @@ + 'Alberta', + 'BC' => 'British Columbia', + 'MB' => 'Manitoba', + 'NB' => 'New Brunswick', + 'NL' => 'Newfoundland And Labrador', + 'NS' => 'Nova Scotia', + 'ON' => 'Ontario', + 'PE' => 'Prince Edward Island', + 'QC' => 'Quebec', + 'SK' => 'Saskatchewan', + 'NT' => 'Northwest Territories', + 'NU' => 'Nunavut', + 'YT' => 'Yukon' + ]; + + /** + * Get the name of the province or territory for a given abbreviation. + * + * @param string $abbreviation + * @return string + */ + public static function getName($abbreviation) { + return self::$provinces[$abbreviation]; + } + + /** + * Get all provinces and territories. + * + * @return array + */ + public static function get() { + return self::$provinces; + } + + /** + * Get the abbreviation for a given province or territory name. + * + * @param string $name + * @return string + */ + public static function getAbbreviation($name) { + return array_search(ucwords($name), self::$provinces); + } +} diff --git a/app/DataProviders/Frequencies.php b/app/DataProviders/Frequencies.php new file mode 100644 index 0000000000..503d40973d --- /dev/null +++ b/app/DataProviders/Frequencies.php @@ -0,0 +1,19 @@ +