1: | <?php
2: | namespace Opencart\Catalog\Model\Account;
3: | /**
4: | * Class Customer Group
5: | *
6: | * @package Opencart\Catalog\Model\Account
7: | */
8: | class CustomerGroup extends \Opencart\System\Engine\Model {
9: | /**
10: | * Get Customer Group
11: | *
12: | * @param int $customer_group_id
13: | *
14: | * @return array<string, mixed>
15: | */
16: | public function getCustomerGroup(int $customer_group_id): array {
17: | $query = $this->db->query("SELECT DISTINCT * FROM `" . DB_PREFIX . "customer_group` `cg` LEFT JOIN `" . DB_PREFIX . "customer_group_description` `cgd` ON (`cg`.`customer_group_id` = `cgd`.`customer_group_id`) WHERE `cg`.`customer_group_id` = '" . (int)$customer_group_id . "' AND `cgd`.`language_id` = '" . (int)$this->config->get('config_language_id') . "'");
18: |
19: | return $query->row;
20: | }
21: |
22: | /**
23: | * Get Customer Groups
24: | *
25: | * @return array<int, array<string, mixed>>
26: | */
27: | public function getCustomerGroups(): array {
28: | $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "customer_group` `cg` LEFT JOIN `" . DB_PREFIX . "customer_group_description` `cgd` ON (`cg`.`customer_group_id` = `cgd`.`customer_group_id`) WHERE `cgd`.`language_id` = '" . (int)$this->config->get('config_language_id') . "' ORDER BY `cg`.`sort_order` ASC, `cgd`.`name` ASC");
29: |
30: | return $query->rows;
31: | }
32: | }
33: |

OpenCart API API documentation generated by ApiGen dev-master