1: <?php
2: namespace Opencart\Catalog\Controller\Cron;
3: /**
4: * Class Gdpr
5: *
6: * @package Opencart\Catalog\Controller\Cron
7: */
8: class Gdpr extends \Opencart\System\Engine\Controller {
9: /**
10: * @param int $cron_id
11: * @param string $code
12: * @param string $cycle
13: * @param string $date_added
14: * @param string $date_modified
15: *
16: * @return void
17: */
18: public function index(int $cron_id, string $code, string $cycle, string $date_added, string $date_modified): void {
19: $this->load->model('account/gdpr');
20: $this->load->model('account/customer');
21:
22: $results = $this->model_account_gdpr->getExpires();
23:
24: foreach ($results as $result) {
25: $this->model_account_gdpr->editStatus($result['gdpr_id'], 3);
26:
27: $customer_info = $this->model_account_customer->getCustomerByEmail($result['email']);
28:
29: if ($customer_info) {
30: $this->model_account_customer->deleteCustomer($customer_info['customer_id']);
31: }
32: }
33: }
34: }
35: