1: | <?php
2: | namespace Opencart\Catalog\Model\Localisation;
3: | /**
4: | * Class Geo Zone
5: | *
6: | * @package Opencart\Catalog\Model\Localisation
7: | */
8: | class GeoZone extends \Opencart\System\Engine\Model {
9: | /**
10: | * Get Geo Zone
11: | *
12: | * @param int $geo_zone_id
13: | * @param int $country_id
14: | * @param int $zone_id
15: | *
16: | * @return array<string, mixed>
17: | */
18: | public function getGeoZone(int $geo_zone_id, int $country_id, int $zone_id): array {
19: | $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone_to_geo_zone` WHERE `geo_zone_id` = '" . (int)$geo_zone_id . "' AND `country_id` = '" . (int)$country_id . "' AND (`zone_id` = '" . (int)$zone_id . "' OR `zone_id` = '0')");
20: |
21: | return $query->row;
22: | }
23: |
24: | /**
25: | * Get Geo Zones
26: | *
27: | * @return array<string, mixed>
28: | */
29: | public function getGeoZones(): array {
30: | $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "geo_zone` ORDER BY `name`");
31: |
32: | return $query->rows;
33: | }
34: | }
35: |

OpenCart API API documentation generated by ApiGen dev-master