1: | <?php
2: | namespace Opencart\Catalog\Controller\Startup;
3: | /**
4: | * Class Event
5: | *
6: | * @package Opencart\Catalog\Controller\Startup
7: | */
8: | class Event extends \Opencart\System\Engine\Controller {
9: | /**
10: | * @return void
11: | */
12: | public function index(): void {
13: | // Add events from the DB
14: | $this->load->model('setting/event');
15: |
16: | $results = $this->model_setting_event->getEvents();
17: |
18: | foreach ($results as $result) {
19: | $part = explode('/', $result['trigger']);
20: |
21: | if ($part[0] == 'catalog') {
22: | array_shift($part);
23: |
24: | $this->event->register(implode('/', $part), new \Opencart\System\Engine\Action($result['action']), $result['sort_order']);
25: | }
26: |
27: | if ($part[0] == 'system') {
28: | $this->event->register($result['trigger'], new \Opencart\System\Engine\Action($result['action']), $result['sort_order']);
29: | }
30: | }
31: | }
32: | }
33: |

OpenCart API API documentation generated by ApiGen dev-master