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

OpenCart API API documentation generated by ApiGen dev-master