| 1: | <?php
|
| 2: | namespace Opencart\Catalog\Model\Design;
|
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: |
|
| 8: | class Layout extends \Opencart\System\Engine\Model {
|
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: |
|
| 16: | public function getLayout(string $route): int {
|
| 17: | $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "layout_route` WHERE '" . $this->db->escape($route) . "' LIKE `route` AND `store_id` = '" . (int)$this->config->get('config_store_id') . "' ORDER BY `route` DESC LIMIT 1");
|
| 18: |
|
| 19: | if ($query->num_rows) {
|
| 20: | return (int)$query->row['layout_id'];
|
| 21: | } else {
|
| 22: | return 0;
|
| 23: | }
|
| 24: | }
|
| 25: |
|
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: |
|
| 34: | public function getModules(int $layout_id, string $position): array {
|
| 35: | $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "layout_module` WHERE `layout_id` = '" . (int)$layout_id . "' AND `position` = '" . $this->db->escape($position) . "' ORDER BY `sort_order`");
|
| 36: |
|
| 37: | return $query->rows;
|
| 38: | }
|
| 39: | }
|
| 40: | |