1: | <?php
2: | namespace Opencart\Catalog\Model\Design;
3: | /**
4: | * Class Seo Url
5: | *
6: | * @package Opencart\Catalog\Model\Design
7: | */
8: | class SeoUrl extends \Opencart\System\Engine\Model {
9: | /**
10: | * Get Seo Url By Keyword
11: | *
12: | * @param string $keyword
13: | *
14: | * @return array<string, mixed>
15: | */
16: | public function getSeoUrlByKeyword(string $keyword): array {
17: | $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "seo_url` WHERE (`keyword` = '" . $this->db->escape($keyword) . "' OR `keyword` LIKE '" . $this->db->escape('%/' . $keyword) . "') AND `store_id` = '" . (int)$this->config->get('config_store_id') . "' LIMIT 1");
18: |
19: | return $query->row;
20: | }
21: |
22: | /**
23: | * Get Seo Url By Key Value
24: | *
25: | * @param string $key
26: | * @param string $value
27: | *
28: | * @return array<string, mixed>
29: | */
30: | public function getSeoUrlByKeyValue(string $key, string $value): array {
31: | $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "seo_url` WHERE `key` = '" . $this->db->escape($key) . "' AND `value` = '" . $this->db->escape($value) . "' AND `store_id` = '" . (int)$this->config->get('config_store_id') . "' AND `language_id` = '" . (int)$this->config->get('config_language_id') . "'");
32: |
33: | return $query->row;
34: | }
35: | }
36: |

OpenCart API API documentation generated by ApiGen dev-master