Ekdant-Online-Store/catalog/model/setting/extension.php

40 lines
991 B
PHP
Raw Permalink Normal View History

2024-08-06 12:21:00 +00:00
<?php
namespace Opencart\Catalog\Model\Setting;
/**
* Class Extension
*
* @package Opencart\Catalog\Model\Setting
*/
class Extension extends \Opencart\System\Engine\Model {
/**
* @return array
*/
public function getExtensions(): array {
$query = $this->db->query("SELECT DISTINCT `extension` FROM `" . DB_PREFIX . "extension`");
return $query->rows;
}
/**
* @param string $type
*
* @return array
*/
public function getExtensionsByType(string $type): array {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "extension` WHERE `type` = '" . $this->db->escape($type) . "'");
return $query->rows;
}
/**
* @param string $type
* @param string $code
*
* @return array
*/
public function getExtensionByCode(string $type, string $code): array {
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "extension` WHERE `type` = '" . $this->db->escape($type) . "' AND `code` = '" . $this->db->escape($code) . "'");
return $query->row;
}
}