|
| 1 | +<?php namespace InvoiceNinja\Models; |
| 2 | + |
| 3 | +use stdClass; |
| 4 | + |
| 5 | +class Statics extends AbstractModel |
| 6 | +{ |
| 7 | + public static $route = 'static'; |
| 8 | + |
| 9 | + public static function all() |
| 10 | + { |
| 11 | + $url = static::getRoute() . '/'; |
| 12 | + |
| 13 | + return static::sendRequest($url, false, 'GET', true); |
| 14 | + } |
| 15 | + |
| 16 | + public static function get($static) |
| 17 | + { |
| 18 | + return json_decode(static::all(), true)['data'][$static]; |
| 19 | + } |
| 20 | + |
| 21 | + public static function countries() |
| 22 | + { |
| 23 | + return static::get('countries'); |
| 24 | + } |
| 25 | + |
| 26 | + public static function currencies() |
| 27 | + { |
| 28 | + return static::get('currencies'); |
| 29 | + } |
| 30 | + |
| 31 | + public static function sizes() |
| 32 | + { |
| 33 | + return static::get('sizes'); |
| 34 | + } |
| 35 | + |
| 36 | + public static function industries() |
| 37 | + { |
| 38 | + return static::get('industries'); |
| 39 | + } |
| 40 | + |
| 41 | + public static function timezones() |
| 42 | + { |
| 43 | + return static::get('timezones'); |
| 44 | + } |
| 45 | + |
| 46 | + public static function dateFormats() |
| 47 | + { |
| 48 | + return static::get('dateFormats'); |
| 49 | + } |
| 50 | + |
| 51 | + public static function datetimeFormats() |
| 52 | + { |
| 53 | + return static::get('datetimeFormats'); |
| 54 | + } |
| 55 | + |
| 56 | + public static function languages() |
| 57 | + { |
| 58 | + return static::get('languages'); |
| 59 | + } |
| 60 | + |
| 61 | + public static function paymentTerms() |
| 62 | + { |
| 63 | + return static::get('paymentTypes'); |
| 64 | + } |
| 65 | + |
| 66 | + public static function invoiceDesigns() |
| 67 | + { |
| 68 | + return static::get('invoiceDesigns'); |
| 69 | + } |
| 70 | + |
| 71 | + public static function invoiceStatus() |
| 72 | + { |
| 73 | + return static::get('invoiceStatus'); |
| 74 | + } |
| 75 | + |
| 76 | + public static function frequencies() |
| 77 | + { |
| 78 | + return static::get('frequencies'); |
| 79 | + } |
| 80 | + |
| 81 | + public static function gateways() |
| 82 | + { |
| 83 | + return static::get('gateways'); |
| 84 | + } |
| 85 | + |
| 86 | + public static function fonts() |
| 87 | + { |
| 88 | + return static::get('fonts'); |
| 89 | + } |
| 90 | + |
| 91 | + public static function banks() |
| 92 | + { |
| 93 | + return static::get('banks'); |
| 94 | + } |
| 95 | +} |
0 commit comments