config = $config; $this->configUtils = $configUtils; $this->serializer = $serializer; } /** * @return bool */ public function isEnabled(): bool { if (! $this->config->isModuleEnabled()) { return false; } if (! $this->configUtils->isSetFlag(self::XML_PATH_ENABLED)) { return false; } if (! $this->getConsentTypesConfig()) { return false; } return true; } /** * Get consent types config. * * @param mixed $store * @return array */ public function getConsentTypesConfig($store = null): array { $config = $this->configUtils->getStoreConfig(self::XML_PATH_CONSENT_TYPES, $store); if (is_string($config)) { $config = $this->serializer->unserialize($config); } $result = []; foreach ($config as $item) { $consentType = $item['consent_type']; $result[$consentType] = [ 'cookie_category' => $item['cookie_category'], 'default_status' => $item['status'], ]; } return $result; } }