From c1e0bd26bbd23ba4ee0cd3d3714e07182992eb90 Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Fri, 29 Mar 2019 11:39:02 +0100 Subject: [PATCH 01/75] do not force reload after save --- Model/Archive/Zip.php | 2 +- Model/EraseCustomerRepository.php | 4 +++- Model/ResourceModel/EraseCustomer/Collection.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Model/Archive/Zip.php b/Model/Archive/Zip.php index bb57500..21362e0 100644 --- a/Model/Archive/Zip.php +++ b/Model/Archive/Zip.php @@ -15,7 +15,7 @@ * Zip compressed file archive with local file name. * @api */ -class Zip implements ArchiveInterface +final class Zip implements ArchiveInterface { /** * @var \Magento\Framework\Filesystem diff --git a/Model/EraseCustomerRepository.php b/Model/EraseCustomerRepository.php index 606b261..90b9e8c 100644 --- a/Model/EraseCustomerRepository.php +++ b/Model/EraseCustomerRepository.php @@ -89,7 +89,9 @@ public function save(EraseCustomerInterface $entity): EraseCustomerInterface { try { $this->eraseCustomerResource->save($entity); - $entity = $this->getById($entity->getEntityId(), true); + + $this->instances[$entity->getEntityId()] = $entity; + $this->instancesByCustomer[$entity->getCustomerId()] = $entity; } catch (\Exception $e) { throw new CouldNotSaveException(new Phrase('Could not save the entity.'), $e); } diff --git a/Model/ResourceModel/EraseCustomer/Collection.php b/Model/ResourceModel/EraseCustomer/Collection.php index 295d282..d7176b7 100755 --- a/Model/ResourceModel/EraseCustomer/Collection.php +++ b/Model/ResourceModel/EraseCustomer/Collection.php @@ -15,7 +15,7 @@ /** * Erase Customer Scheduler Collection */ -class Collection extends AbstractCollection +final class Collection extends AbstractCollection { /** * {@inheritdoc} From 0c42f8c73bf836fb2c695a05cb4f24bd1bd35ee0 Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Fri, 29 Mar 2019 18:17:52 +0100 Subject: [PATCH 02/75] WIP entity value processor --- Model/Entity/EntityIterator.php | 48 +++++++++++++++++ Model/Entity/EntityIteratorInterface.php | 22 ++++++++ .../EntityValue/CustomAttributesProcessor.php | 54 +++++++++++++++++++ Model/Entity/EntityValue/DefaultProcessor.php | 38 +++++++++++++ .../EntityValue/ExtensibleDataProcessor.php | 53 ++++++++++++++++++ .../Entity/EntityValue/StrategyProcessor.php | 40 ++++++++++++++ .../Entity/EntityValueProcessorInterface.php | 24 +++++++++ Service/Anonymize/ConfigInterface.php | 21 ++++++++ .../EntityValue/VirtualProcessor.php | 41 ++++++++++++++ Service/Anonymize/VirtualConfig.php | 54 +++++++++++++++++++ Service/Export/ConfigInterface.php | 21 ++++++++ .../EntityValue/VirtualProcessor.php | 41 ++++++++++++++ .../Utils/CompositeDataFilterProcessor.php | 45 ---------------- .../Utils/CustomAttributesFilterProcessor.php | 40 -------------- .../Processor/Utils/DataFilterProcessor.php | 26 --------- .../Utils/DataFilterProcessorInterface.php | 24 --------- .../Utils/ExtensibleDataFilterProcessor.php | 40 -------------- Service/Export/VirtualConfig.php | 54 +++++++++++++++++++ etc/di.xml | 15 ------ 19 files changed, 511 insertions(+), 190 deletions(-) create mode 100644 Model/Entity/EntityIterator.php create mode 100644 Model/Entity/EntityIteratorInterface.php create mode 100644 Model/Entity/EntityValue/CustomAttributesProcessor.php create mode 100644 Model/Entity/EntityValue/DefaultProcessor.php create mode 100644 Model/Entity/EntityValue/ExtensibleDataProcessor.php create mode 100644 Model/Entity/EntityValue/StrategyProcessor.php create mode 100644 Model/Entity/EntityValueProcessorInterface.php create mode 100644 Service/Anonymize/ConfigInterface.php create mode 100644 Service/Anonymize/Processor/EntityValue/VirtualProcessor.php create mode 100644 Service/Anonymize/VirtualConfig.php create mode 100644 Service/Export/ConfigInterface.php create mode 100644 Service/Export/Processor/EntityValue/VirtualProcessor.php delete mode 100644 Service/Export/Processor/Utils/CompositeDataFilterProcessor.php delete mode 100644 Service/Export/Processor/Utils/CustomAttributesFilterProcessor.php delete mode 100644 Service/Export/Processor/Utils/DataFilterProcessor.php delete mode 100644 Service/Export/Processor/Utils/DataFilterProcessorInterface.php delete mode 100644 Service/Export/Processor/Utils/ExtensibleDataFilterProcessor.php create mode 100644 Service/Export/VirtualConfig.php diff --git a/Model/Entity/EntityIterator.php b/Model/Entity/EntityIterator.php new file mode 100644 index 0000000..525d8b7 --- /dev/null +++ b/Model/Entity/EntityIterator.php @@ -0,0 +1,48 @@ +hydrator = $hydrator; + $this->processor = $processor; + } + + /** + * {@inheritdoc} + */ + public function iterate($entity): void + { + foreach ($this->hydrator->extract($entity) as $key => $value) { + $this->processor->process($entity, $key, $value); + } + } +} diff --git a/Model/Entity/EntityIteratorInterface.php b/Model/Entity/EntityIteratorInterface.php new file mode 100644 index 0000000..2096397 --- /dev/null +++ b/Model/Entity/EntityIteratorInterface.php @@ -0,0 +1,22 @@ +processor = $processor; + } + + /** + * {@inheritdoc} + */ + public function process($entity, string $key, $value): void + { + if ($this->isValid($entity, $key)) { + $this->processor->process($entity, $key, $value); + } + } + + /** + * Check wether the entity object and the value key are valid + * + * @param object $entity + * @param string $key + * @return bool + */ + private function isValid($entity, string $key): bool + { + return $entity instanceof CustomAttributesDataInterface && + $key === CustomAttributesDataInterface::CUSTOM_ATTRIBUTES; + } +} diff --git a/Model/Entity/EntityValue/DefaultProcessor.php b/Model/Entity/EntityValue/DefaultProcessor.php new file mode 100644 index 0000000..e4854f6 --- /dev/null +++ b/Model/Entity/EntityValue/DefaultProcessor.php @@ -0,0 +1,38 @@ +processor = $processor; + } + + /** + * {@inheritdoc} + */ + public function process($entity, string $key, $value): void + { + $this->processor->process($entity, $key, $value); + } +} diff --git a/Model/Entity/EntityValue/ExtensibleDataProcessor.php b/Model/Entity/EntityValue/ExtensibleDataProcessor.php new file mode 100644 index 0000000..1eb2753 --- /dev/null +++ b/Model/Entity/EntityValue/ExtensibleDataProcessor.php @@ -0,0 +1,53 @@ +processor = $processor; + } + + /** + * {@inheritdoc} + */ + public function process($entity, string $key, $value): void + { + if ($this->isValid($entity, $key)) { + $this->processor->process($entity, $key, $value); + } + } + + /** + * Check wether the entity object and the value key are valid + * + * @param object $entity + * @param string $key + * @return bool + */ + private function isValid($entity, string $key): bool + { + return $entity instanceof ExtensibleDataInterface && $key === ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY; + } +} diff --git a/Model/Entity/EntityValue/StrategyProcessor.php b/Model/Entity/EntityValue/StrategyProcessor.php new file mode 100644 index 0000000..9bbb0aa --- /dev/null +++ b/Model/Entity/EntityValue/StrategyProcessor.php @@ -0,0 +1,40 @@ +processors = (static function (EntityValueProcessorInterface ...$processors): array { + return $processors; + })(...$processors); + } + + /** + * {@inheritdoc} + */ + public function process($entity, string $key, $value): void + { + ($this->processors[$key] ?? $this->processors['default'])->process($entity, $key, $value); + } +} diff --git a/Model/Entity/EntityValueProcessorInterface.php b/Model/Entity/EntityValueProcessorInterface.php new file mode 100644 index 0000000..ba2914c --- /dev/null +++ b/Model/Entity/EntityValueProcessorInterface.php @@ -0,0 +1,24 @@ +config = $config; + } + + /** + * {@inheritdoc} + */ + public function process($entity, string $key, $value): void + { + if (\in_array($key, $this->config->getAttributes())) { + // todo anonymize value and push it in the entity object + } + } +} diff --git a/Service/Anonymize/VirtualConfig.php b/Service/Anonymize/VirtualConfig.php new file mode 100644 index 0000000..a67ae11 --- /dev/null +++ b/Service/Anonymize/VirtualConfig.php @@ -0,0 +1,54 @@ +scopeConfig = $scopeConfig; + $this->configPath = $configPath; + $this->scopeType = $scopeType; + } + + /** + * {@inheritdoc} + */ + public function getAttributes(?string $scopeCode = null): array + { + return \explode(',', $this->scopeConfig->getValue($this->configPath, $this->scopeType, $scopeCode) ?? ''); + } +} diff --git a/Service/Export/ConfigInterface.php b/Service/Export/ConfigInterface.php new file mode 100644 index 0000000..86b39eb --- /dev/null +++ b/Service/Export/ConfigInterface.php @@ -0,0 +1,21 @@ +config = $config; + } + + /** + * {@inheritdoc} + */ + public function process($entity, string $key, $value): void + { + if (\in_array($key, $this->config->getAttributes())) { + // todo Add value to the Container of DocumentInterface from the export service + } + } +} diff --git a/Service/Export/Processor/Utils/CompositeDataFilterProcessor.php b/Service/Export/Processor/Utils/CompositeDataFilterProcessor.php deleted file mode 100644 index 1898437..0000000 --- a/Service/Export/Processor/Utils/CompositeDataFilterProcessor.php +++ /dev/null @@ -1,45 +0,0 @@ -processorPool = $processorPool; - } - - /** - * {@inheritdoc} - */ - public function execute(array $scheme, array $data): array - { - $result = []; - - /** @var \Opengento\Gdpr\Service\Export\Processor\Utils\DataFilterProcessorInterface $processor */ - foreach ($this->processorPool->getIterator() as $processor) { - $result[] = $processor->execute($scheme, $data); - } - - return \array_merge(...$result); - } -} diff --git a/Service/Export/Processor/Utils/CustomAttributesFilterProcessor.php b/Service/Export/Processor/Utils/CustomAttributesFilterProcessor.php deleted file mode 100644 index bd5b6c0..0000000 --- a/Service/Export/Processor/Utils/CustomAttributesFilterProcessor.php +++ /dev/null @@ -1,40 +0,0 @@ -dataFilterProcessor = $dataFilterProcessor; - } - - /** - * {@inheritdoc} - */ - public function execute(array $scheme, array $data = []): array - { - return isset($data[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES]) - ? $this->dataFilterProcessor->execute($scheme, $data[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES]) - : []; - } -} diff --git a/Service/Export/Processor/Utils/DataFilterProcessor.php b/Service/Export/Processor/Utils/DataFilterProcessor.php deleted file mode 100644 index 344f7c6..0000000 --- a/Service/Export/Processor/Utils/DataFilterProcessor.php +++ /dev/null @@ -1,26 +0,0 @@ -dataFilterProcessor = $dataFilterProcessor; - } - - /** - * {@inheritdoc} - */ - public function execute(array $scheme, array $data = []): array - { - return $data[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY] - ? $this->dataFilterProcessor->execute($scheme, $data[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]) - : []; - } -} diff --git a/Service/Export/VirtualConfig.php b/Service/Export/VirtualConfig.php new file mode 100644 index 0000000..e41fd94 --- /dev/null +++ b/Service/Export/VirtualConfig.php @@ -0,0 +1,54 @@ +scopeConfig = $scopeConfig; + $this->configPath = $configPath; + $this->scopeType = $scopeType; + } + + /** + * {@inheritdoc} + */ + public function getAttributes(?string $scopeCode = null): array + { + return \explode(',', $this->scopeConfig->getValue($this->configPath, $this->scopeType, $scopeCode) ?? ''); + } +} diff --git a/etc/di.xml b/etc/di.xml index 6c57bb3..293d8ff 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -55,21 +55,6 @@ - - - Opengento\Gdpr\Service\Export\Processor\Utils\DataFilterProcessorInterface - - Opengento\Gdpr\Service\Export\Processor\Utils\DataFilterProcessor - Opengento\Gdpr\Service\Export\Processor\Utils\CustomAttributesFilterProcessor - Opengento\Gdpr\Service\Export\Processor\Utils\ExtensibleDataFilterProcessor - - - - - - Opengento\Gdpr\Service\Export\Processor\Utils\ProcessorPool - - Opengento\Gdpr\Service\Export\ProcessorInterface From f8e1883b1bb83a50d4b9d50937ca03206319a5fc Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Thu, 18 Apr 2019 17:56:37 +0200 Subject: [PATCH 03/75] implement export entity iterator --- Model/Config.php | 22 - .../Entity/EntityValue/StrategyProcessor.php | 4 +- Service/Anonymize/AccountBlocker.php | 2 + .../Processor/Entity/Config.php} | 6 +- .../Processor/Entity}/ConfigInterface.php | 2 +- .../EntityValue/Processor.php} | 14 +- Service/AnonymizeManagement.php | 1 + Service/DeleteManagement.php | 1 + .../CustomerAddressDataProcessor.php | 51 +-- .../Processor/CustomerDataProcessor.php | 43 +- .../Processor/Entity/Config.php} | 6 +- .../Processor/Entity}/ConfigInterface.php | 2 +- .../Export/Processor/Entity/DataCollector.php | 48 +++ .../Entity/DataCollectorInterface.php | 22 + Service/Export/Processor/Entity/Document.php | 54 +++ .../Processor/Entity/DocumentInterface.php | 38 ++ .../Entity/EntityValue/Processor.php | 50 +++ .../EntityValue/VirtualProcessor.php | 41 -- .../Export/Processor/OrderDataProcessor.php | 31 +- .../Export/Processor/QuoteDataProcessor.php | 31 +- .../Processor/SubscriberDataProcessor.php | 13 +- Service/ExportManagement.php | 1 + etc/di.xml | 375 ++++++++++++++++++ view/frontend/templates/messages/popup.phtml | 2 +- 24 files changed, 654 insertions(+), 206 deletions(-) rename Service/{Export/VirtualConfig.php => Anonymize/Processor/Entity/Config.php} (90%) rename Service/{Export => Anonymize/Processor/Entity}/ConfigInterface.php (84%) rename Service/Anonymize/Processor/{EntityValue/VirtualProcessor.php => Entity/EntityValue/Processor.php} (55%) rename Service/{Anonymize/VirtualConfig.php => Export/Processor/Entity/Config.php} (90%) rename Service/{Anonymize => Export/Processor/Entity}/ConfigInterface.php (85%) create mode 100644 Service/Export/Processor/Entity/DataCollector.php create mode 100644 Service/Export/Processor/Entity/DataCollectorInterface.php create mode 100644 Service/Export/Processor/Entity/Document.php create mode 100644 Service/Export/Processor/Entity/DocumentInterface.php create mode 100644 Service/Export/Processor/Entity/EntityValue/Processor.php delete mode 100644 Service/Export/Processor/EntityValue/VirtualProcessor.php diff --git a/Model/Config.php b/Model/Config.php index 3f579c8..c2956c8 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -31,8 +31,6 @@ final class Config public const CONFIG_PATH_EXPORT_ENABLED = 'gdpr/export/enabled'; public const CONFIG_PATH_EXPORT_INFORMATION_BLOCK = 'gdpr/export/block_id'; public const CONFIG_PATH_EXPORT_RENDERER = 'gdpr/export/renderer'; - public const CONFIG_PATH_EXPORT_CUSTOMER_ATTRIBUTES = 'gdpr/export/customer_attributes'; - public const CONFIG_PATH_EXPORT_CUSTOMER_ADDRESS_ATTRIBUTES = 'gdpr/export/customer_address_attributes'; public const CONFIG_PATH_COOKIE_DISCLOSURE_ENABLED = 'gdpr/cookie/enabled'; public const CONFIG_PATH_COOKIE_INFORMATION_BLOCK = 'gdpr/cookie/block_id'; /**#@-*/ @@ -181,26 +179,6 @@ public function getExportRendererCode(): string return $this->getValueString(self::CONFIG_PATH_EXPORT_RENDERER, ScopeInterface::SCOPE_STORE); } - /** - * Retrieve the export customer attributes codes - * - * @return array - */ - public function getExportCustomerAttributes(): array - { - return $this->getValueArray(self::CONFIG_PATH_EXPORT_CUSTOMER_ATTRIBUTES, ScopeInterface::SCOPE_STORE); - } - - /** - * Retrieve the export customer address attributes codes - * - * @return array - */ - public function getExportCustomerAddressAttributes(): array - { - return $this->getValueArray(self::CONFIG_PATH_EXPORT_CUSTOMER_ADDRESS_ATTRIBUTES, ScopeInterface::SCOPE_STORE); - } - /** * Check if the cookie disclosure is enabled * diff --git a/Model/Entity/EntityValue/StrategyProcessor.php b/Model/Entity/EntityValue/StrategyProcessor.php index 9bbb0aa..28fe920 100644 --- a/Model/Entity/EntityValue/StrategyProcessor.php +++ b/Model/Entity/EntityValue/StrategyProcessor.php @@ -27,7 +27,9 @@ public function __construct( ) { $this->processors = (static function (EntityValueProcessorInterface ...$processors): array { return $processors; - })(...$processors); + })(...\array_values($processors)); + + $this->processors = \array_combine(\array_keys($processors), $this->processors); } /** diff --git a/Service/Anonymize/AccountBlocker.php b/Service/Anonymize/AccountBlocker.php index e441d97..61690fd 100644 --- a/Service/Anonymize/AccountBlocker.php +++ b/Service/Anonymize/AccountBlocker.php @@ -91,6 +91,7 @@ public function __construct( * @param int $customerId * @return bool * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\LocalizedException */ public function invalid(int $customerId): bool { @@ -103,6 +104,7 @@ public function invalid(int $customerId): bool * @param int $customerId * @return bool * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\LocalizedException */ private function resetPassword(int $customerId): bool { diff --git a/Service/Export/VirtualConfig.php b/Service/Anonymize/Processor/Entity/Config.php similarity index 90% rename from Service/Export/VirtualConfig.php rename to Service/Anonymize/Processor/Entity/Config.php index e41fd94..9ef9cc7 100644 --- a/Service/Export/VirtualConfig.php +++ b/Service/Anonymize/Processor/Entity/Config.php @@ -5,14 +5,14 @@ */ declare(strict_types=1); -namespace Opengento\Gdpr\Service\Export; +namespace Opengento\Gdpr\Service\Anonymize\Processor\Entity; use Magento\Framework\App\Config\ScopeConfigInterface; /** - * Class VirtualConfig + * Class Config */ -class VirtualConfig implements ConfigInterface +final class Config implements ConfigInterface { /** * @var \Magento\Framework\App\Config\ScopeConfigInterface diff --git a/Service/Export/ConfigInterface.php b/Service/Anonymize/Processor/Entity/ConfigInterface.php similarity index 84% rename from Service/Export/ConfigInterface.php rename to Service/Anonymize/Processor/Entity/ConfigInterface.php index 86b39eb..6af5cf7 100644 --- a/Service/Export/ConfigInterface.php +++ b/Service/Anonymize/Processor/Entity/ConfigInterface.php @@ -4,7 +4,7 @@ * See LICENSE bundled with this library for license details. */ -namespace Opengento\Gdpr\Service\Export; +namespace Opengento\Gdpr\Service\Anonymize\Processor\Entity; /** * Interface ConfigInterface diff --git a/Service/Anonymize/Processor/EntityValue/VirtualProcessor.php b/Service/Anonymize/Processor/Entity/EntityValue/Processor.php similarity index 55% rename from Service/Anonymize/Processor/EntityValue/VirtualProcessor.php rename to Service/Anonymize/Processor/Entity/EntityValue/Processor.php index a77f41f..af5aa60 100644 --- a/Service/Anonymize/Processor/EntityValue/VirtualProcessor.php +++ b/Service/Anonymize/Processor/Entity/EntityValue/Processor.php @@ -5,23 +5,23 @@ */ declare(strict_types=1); -namespace Opengento\Gdpr\Service\Anonymize\Processor\EntityValue; +namespace Opengento\Gdpr\Service\Anonymize\Processor\Entity\EntityValue; use Opengento\Gdpr\Model\Entity\EntityValueProcessorInterface; -use Opengento\Gdpr\Service\Anonymize\ConfigInterface; +use Opengento\Gdpr\Service\Anonymize\Processor\Entity\ConfigInterface; /** - * Class VirtualProcessor + * Class Processor */ -class VirtualProcessor implements EntityValueProcessorInterface +final class Processor implements EntityValueProcessorInterface { /** - * @var \Opengento\Gdpr\Service\Anonymize\ConfigInterface + * @var \Opengento\Gdpr\Service\Anonymize\Processor\Entity\ConfigInterface */ private $config; /** - * @param \Opengento\Gdpr\Service\Anonymize\ConfigInterface $config + * @param \Opengento\Gdpr\Service\Anonymize\Processor\Entity\ConfigInterface $config */ public function __construct( ConfigInterface $config @@ -34,7 +34,7 @@ public function __construct( */ public function process($entity, string $key, $value): void { - if (\in_array($key, $this->config->getAttributes())) { + if (\in_array($key, $this->config->getAttributes(), true)) { // todo anonymize value and push it in the entity object } } diff --git a/Service/AnonymizeManagement.php b/Service/AnonymizeManagement.php index 20f2758..4c5addd 100644 --- a/Service/AnonymizeManagement.php +++ b/Service/AnonymizeManagement.php @@ -62,6 +62,7 @@ public function executeProcessor(string $processorName, int $customerId): bool /** @var \Opengento\Gdpr\Service\Anonymize\ProcessorInterface $processor */ $processor = $this->processorPool->offsetGet($processorName); + return $processor->execute($customerId); } } diff --git a/Service/DeleteManagement.php b/Service/DeleteManagement.php index ec604b9..1d80db5 100644 --- a/Service/DeleteManagement.php +++ b/Service/DeleteManagement.php @@ -62,6 +62,7 @@ public function executeProcessor(string $processorName, int $customerId): bool /** @var \Opengento\Gdpr\Service\Delete\ProcessorInterface $processor */ $processor = $this->processorPool->offsetGet($processorName); + return $processor->execute($customerId); } } diff --git a/Service/Export/Processor/CustomerAddressDataProcessor.php b/Service/Export/Processor/CustomerAddressDataProcessor.php index adc2ea8..5281899 100644 --- a/Service/Export/Processor/CustomerAddressDataProcessor.php +++ b/Service/Export/Processor/CustomerAddressDataProcessor.php @@ -9,9 +9,7 @@ use Magento\Customer\Api\AddressRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\Api\SearchResultsInterface; -use Magento\Framework\EntityManager\Hydrator; -use Opengento\Gdpr\Model\Config; +use Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface; use Opengento\Gdpr\Service\Export\ProcessorInterface; /** @@ -30,31 +28,23 @@ final class CustomerAddressDataProcessor implements ProcessorInterface private $searchCriteriaBuilder; /** - * @var \Magento\Framework\EntityManager\Hydrator + * @var \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface */ - private $hydrator; - - /** - * @var \Opengento\Gdpr\Model\Config - */ - private $config; + private $dataCollector; /** * @param \Magento\Customer\Api\AddressRepositoryInterface $addressRepository * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder - * @param \Magento\Framework\EntityManager\Hydrator $hydrator - * @param \Opengento\Gdpr\Model\Config $config + * @param \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface $dataCollector */ public function __construct( AddressRepositoryInterface $addressRepository, SearchCriteriaBuilder $searchCriteriaBuilder, - Hydrator $hydrator, - Config $config + DataCollectorInterface $dataCollector ) { $this->addressRepository = $addressRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; - $this->hydrator = $hydrator; - $this->config = $config; + $this->dataCollector = $dataCollector; } /** @@ -65,35 +55,12 @@ public function execute(int $customerId, array $data): array { $this->searchCriteriaBuilder->addFilter('parent_id', $customerId); $addressList = $this->addressRepository->getList($this->searchCriteriaBuilder->create()); - $data['customer_addresses'] = $this->generateArray($addressList); - - return $data; - } - - /** - * Collect the customer addresses data to export - * - * @param \Magento\Framework\Api\SearchResultsInterface $searchResults - * @return array - */ - private function generateArray(SearchResultsInterface $searchResults): array - { - $result = []; /** @var \Magento\Customer\Api\Data\AddressInterface $entity */ - foreach ($searchResults->getItems() as $entity) { - $data = []; - $entityData = $this->hydrator->extract($entity); - - foreach ($this->config->getExportCustomerAddressAttributes() as $attributeCode) { - if (isset($entityData[$attributeCode])) { - $data[$attributeCode] = $entityData[$attributeCode]; - } - } - - $result['customer_address_id_' . $entity->getId()] = $data; + foreach ($addressList->getItems() as $entity) { + $data['customer_addresses']['customer_address_id_' . $entity->getId()] = $this->dataCollector->collect($entity); } - return $result; + return $data; } } diff --git a/Service/Export/Processor/CustomerDataProcessor.php b/Service/Export/Processor/CustomerDataProcessor.php index a0f1bc8..a2ae8fa 100644 --- a/Service/Export/Processor/CustomerDataProcessor.php +++ b/Service/Export/Processor/CustomerDataProcessor.php @@ -8,8 +8,7 @@ namespace Opengento\Gdpr\Service\Export\Processor; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Framework\EntityManager\Hydrator; -use Opengento\Gdpr\Model\Config; +use Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface; use Opengento\Gdpr\Service\Export\ProcessorInterface; /** @@ -23,28 +22,20 @@ final class CustomerDataProcessor implements ProcessorInterface private $customerRepository; /** - * @var \Magento\Framework\EntityManager\Hydrator + * @var \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface */ - private $hydrator; - - /** - * @var \Opengento\Gdpr\Model\Config - */ - private $config; + private $dataCollector; /** * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository - * @param \Magento\Framework\EntityManager\Hydrator $hydrator - * @param \Opengento\Gdpr\Model\Config $config + * @param \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface $dataCollector */ public function __construct( CustomerRepositoryInterface $customerRepository, - Hydrator $hydrator, - Config $config + DataCollectorInterface $dataCollector ) { $this->customerRepository = $customerRepository; - $this->hydrator = $hydrator; - $this->config = $config; + $this->dataCollector = $dataCollector; } /** @@ -54,27 +45,7 @@ public function __construct( */ public function execute(int $customerId, array $data): array { - $customerData = $this->hydrator->extract($this->customerRepository->getById($customerId)); - $data['customer'] = $this->generateArray($customerData); - - return $data; - } - - /** - * Collect the customer data to export - * - * @param array $customerData - * @return array - */ - private function generateArray(array $customerData): array - { - $data = []; - - foreach ($this->config->getExportCustomerAttributes() as $attributeCode) { - if (isset($customerData[$attributeCode])) { - $data[$attributeCode] = $customerData[$attributeCode]; - } - } + $data['customer'] = $this->dataCollector->collect($this->customerRepository->getById($customerId)); return $data; } diff --git a/Service/Anonymize/VirtualConfig.php b/Service/Export/Processor/Entity/Config.php similarity index 90% rename from Service/Anonymize/VirtualConfig.php rename to Service/Export/Processor/Entity/Config.php index a67ae11..cea9f9c 100644 --- a/Service/Anonymize/VirtualConfig.php +++ b/Service/Export/Processor/Entity/Config.php @@ -5,14 +5,14 @@ */ declare(strict_types=1); -namespace Opengento\Gdpr\Service\Anonymize; +namespace Opengento\Gdpr\Service\Export\Processor\Entity; use Magento\Framework\App\Config\ScopeConfigInterface; /** - * Class VirtualConfig + * Class Config */ -class VirtualConfig implements ConfigInterface +final class Config implements ConfigInterface { /** * @var \Magento\Framework\App\Config\ScopeConfigInterface diff --git a/Service/Anonymize/ConfigInterface.php b/Service/Export/Processor/Entity/ConfigInterface.php similarity index 85% rename from Service/Anonymize/ConfigInterface.php rename to Service/Export/Processor/Entity/ConfigInterface.php index 36ac94a..878a4ff 100644 --- a/Service/Anonymize/ConfigInterface.php +++ b/Service/Export/Processor/Entity/ConfigInterface.php @@ -4,7 +4,7 @@ * See LICENSE bundled with this library for license details. */ -namespace Opengento\Gdpr\Service\Anonymize; +namespace Opengento\Gdpr\Service\Export\Processor\Entity; /** * Interface ConfigInterface diff --git a/Service/Export/Processor/Entity/DataCollector.php b/Service/Export/Processor/Entity/DataCollector.php new file mode 100644 index 0000000..0dbe661 --- /dev/null +++ b/Service/Export/Processor/Entity/DataCollector.php @@ -0,0 +1,48 @@ +entityIterator = $entityIterator; + $this->document = $document; + } + + /** + * {@inheritdoc} + */ + public function collect($entity): array + { + $this->entityIterator->iterate($entity); + + return $this->document->getData(); + } +} diff --git a/Service/Export/Processor/Entity/DataCollectorInterface.php b/Service/Export/Processor/Entity/DataCollectorInterface.php new file mode 100644 index 0000000..d3d1cbf --- /dev/null +++ b/Service/Export/Processor/Entity/DataCollectorInterface.php @@ -0,0 +1,22 @@ +data = $data; + } + + /** + * {@inheritdoc} + */ + public function setData(array $data): void + { + $this->data = $data; + } + + /** + * {@inheritdoc} + */ + public function addData(string $key, $value): void + { + $this->data[$key] = $value; + } + + /** + * {@inheritdoc} + */ + public function getData(): array + { + $data = $this->data; + $this->data = []; + + return $data; + } +} diff --git a/Service/Export/Processor/Entity/DocumentInterface.php b/Service/Export/Processor/Entity/DocumentInterface.php new file mode 100644 index 0000000..67d26cc --- /dev/null +++ b/Service/Export/Processor/Entity/DocumentInterface.php @@ -0,0 +1,38 @@ +document = $document; + $this->config = $config; + } + + /** + * {@inheritdoc} + */ + public function process($entity, string $key, $value): void + { + if (\in_array($key, $this->config->getAttributes(), true)) { + $this->document->addData($key, $value); + } + } +} diff --git a/Service/Export/Processor/EntityValue/VirtualProcessor.php b/Service/Export/Processor/EntityValue/VirtualProcessor.php deleted file mode 100644 index fbf1a10..0000000 --- a/Service/Export/Processor/EntityValue/VirtualProcessor.php +++ /dev/null @@ -1,41 +0,0 @@ -config = $config; - } - - /** - * {@inheritdoc} - */ - public function process($entity, string $key, $value): void - { - if (\in_array($key, $this->config->getAttributes())) { - // todo Add value to the Container of DocumentInterface from the export service - } - } -} diff --git a/Service/Export/Processor/OrderDataProcessor.php b/Service/Export/Processor/OrderDataProcessor.php index 3a3cee6..7bc5a7d 100644 --- a/Service/Export/Processor/OrderDataProcessor.php +++ b/Service/Export/Processor/OrderDataProcessor.php @@ -8,10 +8,9 @@ namespace Opengento\Gdpr\Service\Export\Processor; use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\Api\SearchResultsInterface; -use Magento\Framework\EntityManager\Hydrator; use Magento\Sales\Api\Data\OrderInterface; use Magento\Sales\Api\OrderRepositoryInterface; +use Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface; use Opengento\Gdpr\Service\Export\ProcessorInterface; /** @@ -30,23 +29,23 @@ final class OrderDataProcessor implements ProcessorInterface private $searchCriteriaBuilder; /** - * @var \Magento\Framework\EntityManager\Hydrator + * @var \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface */ - private $hydrator; + private $dataCollector; /** * @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder - * @param \Magento\Framework\EntityManager\Hydrator $hydrator + * @param \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface $dataCollector */ public function __construct( OrderRepositoryInterface $orderRepository, SearchCriteriaBuilder $searchCriteriaBuilder, - Hydrator $hydrator + DataCollectorInterface $dataCollector ) { $this->orderRepository = $orderRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; - $this->hydrator = $hydrator; + $this->dataCollector = $dataCollector; } /** @@ -56,24 +55,10 @@ public function execute(int $customerId, array $data): array { $searchCriteria = $this->searchCriteriaBuilder->addFilter(OrderInterface::CUSTOMER_ID, $customerId); $orderList = $this->orderRepository->getList($searchCriteria->create()); - $data['orders'] = $this->generateArray($orderList); - - return $data; - } - - /** - * Collect the customer orders data to export - * - * @param \Magento\Framework\Api\SearchResultsInterface $searchResults - * @return array - */ - private function generateArray(SearchResultsInterface $searchResults): array - { - $data = []; /** @var \Magento\Sales\Api\Data\OrderInterface $entity */ - foreach ($searchResults->getItems() as $entity) { - $data['order_id_' . $entity->getEntityId()] = $this->hydrator->extract($entity); + foreach ($orderList->getItems() as $entity) { + $data['orders']['order_id_' . $entity->getEntityId()] = $this->dataCollector->collect($entity); } return $data; diff --git a/Service/Export/Processor/QuoteDataProcessor.php b/Service/Export/Processor/QuoteDataProcessor.php index a1b2819..b88bc69 100644 --- a/Service/Export/Processor/QuoteDataProcessor.php +++ b/Service/Export/Processor/QuoteDataProcessor.php @@ -8,9 +8,8 @@ namespace Opengento\Gdpr\Service\Export\Processor; use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\Api\SearchResultsInterface; -use Magento\Framework\EntityManager\Hydrator; use Magento\Quote\Api\CartRepositoryInterface; +use Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface; use Opengento\Gdpr\Service\Export\ProcessorInterface; /** @@ -29,23 +28,23 @@ final class QuoteDataProcessor implements ProcessorInterface private $searchCriteriaBuilder; /** - * @var \Magento\Framework\EntityManager\Hydrator + * @var \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface */ - private $hydrator; + private $dataCollector; /** * @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder - * @param \Magento\Framework\EntityManager\Hydrator $hydrator + * @param \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface $dataCollector */ public function __construct( CartRepositoryInterface $quoteRepository, SearchCriteriaBuilder $searchCriteriaBuilder, - Hydrator $hydrator + DataCollectorInterface $dataCollector ) { $this->quoteRepository = $quoteRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; - $this->hydrator = $hydrator; + $this->dataCollector = $dataCollector; } /** @@ -55,24 +54,10 @@ public function execute(int $customerId, array $data): array { $searchCriteria = $this->searchCriteriaBuilder->addFilter('customer_id', $customerId); $quoteList = $this->quoteRepository->getList($searchCriteria->create()); - $data['quotes'] = $this->generateArray($quoteList); - - return $data; - } - - /** - * Collect the customer quotes data to export - * - * @param \Magento\Framework\Api\SearchResultsInterface $searchResults - * @return array - */ - private function generateArray(SearchResultsInterface $searchResults): array - { - $data = []; /** @var \Magento\Quote\Api\Data\CartInterface $entity */ - foreach ($searchResults->getItems() as $entity) { - $data['quote_id_' . $entity->getId()] = $this->hydrator->extract($entity); + foreach ($quoteList->getItems() as $entity) { + $data['quotes']['quote_id_' . $entity->getId()] = $this->dataCollector->collect($entity); } return $data; diff --git a/Service/Export/Processor/SubscriberDataProcessor.php b/Service/Export/Processor/SubscriberDataProcessor.php index 65d96fd..2115152 100644 --- a/Service/Export/Processor/SubscriberDataProcessor.php +++ b/Service/Export/Processor/SubscriberDataProcessor.php @@ -8,6 +8,7 @@ namespace Opengento\Gdpr\Service\Export\Processor; use Magento\Newsletter\Model\SubscriberFactory; +use Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface; use Opengento\Gdpr\Service\Export\ProcessorInterface; /** @@ -20,13 +21,21 @@ final class SubscriberDataProcessor implements ProcessorInterface */ private $subscriberFactory; + /** + * @var \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface + */ + private $dataCollector; + /** * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param \Opengento\Gdpr\Service\Export\Processor\Entity\DataCollectorInterface $dataCollector */ public function __construct( - SubscriberFactory $subscriberFactory + SubscriberFactory $subscriberFactory, + DataCollectorInterface $dataCollector ) { $this->subscriberFactory = $subscriberFactory; + $this->dataCollector = $dataCollector; } /** @@ -37,7 +46,7 @@ public function execute(int $customerId, array $data): array /** @var \Magento\Newsletter\Model\Subscriber $subscriber */ $subscriber = $this->subscriberFactory->create(); $subscriber->loadByCustomerId($customerId); - $data['subscribers'] = $subscriber->toArray(); + $data['subscriber'] = $this->dataCollector->collect($subscriber); return $data; } diff --git a/Service/ExportManagement.php b/Service/ExportManagement.php index a6adfec..3643c16 100644 --- a/Service/ExportManagement.php +++ b/Service/ExportManagement.php @@ -62,6 +62,7 @@ public function executeProcessor(string $processorName, int $customerId): array /** @var \Opengento\Gdpr\Service\Export\ProcessorInterface $processor */ $processor = $this->processorPool->offsetGet($processorName); + return $processor->execute($customerId, []); } } diff --git a/etc/di.xml b/etc/di.xml index 293d8ff..c2d4b13 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -72,6 +72,381 @@ Opengento\Gdpr\Service\Export\ProcessorPool + + + + + gdpr/export/customer_attributes + + + + + gdpr/export/customer_custom_attributes + + + + + gdpr/export/customer_extensible_data + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\Document + Opengento\Gdpr\Service\Export\Processor\Customer\Config\AttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\Document + Opengento\Gdpr\Service\Export\Processor\Customer\Config\CustomAttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\Document + Opengento\Gdpr\Service\Export\Processor\Customer\Config\ExtensibleDataConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\EntityValue\AttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\EntityValue\CustomAttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\EntityValue\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\AttributesProcessor + Opengento\Gdpr\Service\Export\Processor\Customer\CustomAttributesProcessor + Opengento\Gdpr\Service\Export\Processor\Customer\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\StrategyProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\EntityIterator + Opengento\Gdpr\Service\Export\Processor\Customer\Document + + + + + Opengento\Gdpr\Service\Export\Processor\Customer\DataCollector + + + + + + + gdpr/export/customer_address_attributes + + + + + gdpr/export/customer_address_custom_attributes + + + + + gdpr/export/customer_address_extensible_data + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\Document + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\Config\AttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\Document + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\Config\CustomAttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\Document + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\Config\ExtensibleDataConfig + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\EntityValue\AttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\EntityValue\CustomAttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\EntityValue\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\AttributesProcessor + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\CustomAttributesProcessor + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\StrategyProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\EntityIterator + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\Document + + + + + Opengento\Gdpr\Service\Export\Processor\CustomerAddress\DataCollector + + + + + + + gdpr/export/quote_attributes + + + + + gdpr/export/quote_custom_attributes + + + + + gdpr/export/quote_extensible_data + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\Document + Opengento\Gdpr\Service\Export\Processor\Quote\Config\AttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\Document + Opengento\Gdpr\Service\Export\Processor\Quote\Config\CustomAttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\Document + Opengento\Gdpr\Service\Export\Processor\Quote\Config\ExtensibleDataConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\EntityValue\AttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\EntityValue\CustomAttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\EntityValue\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\AttributesProcessor + Opengento\Gdpr\Service\Export\Processor\Quote\CustomAttributesProcessor + Opengento\Gdpr\Service\Export\Processor\Quote\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\StrategyProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\EntityIterator + Opengento\Gdpr\Service\Export\Processor\Quote\Document + + + + + Opengento\Gdpr\Service\Export\Processor\Quote\DataCollector + + + + + + + gdpr/export/order_attributes + + + + + gdpr/export/order_custom_attributes + + + + + gdpr/export/order_extensible_data + + + + + Opengento\Gdpr\Service\Export\Processor\Order\Document + Opengento\Gdpr\Service\Export\Processor\Order\Config\AttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Order\Document + Opengento\Gdpr\Service\Export\Processor\Order\Config\CustomAttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Order\Document + Opengento\Gdpr\Service\Export\Processor\Order\Config\ExtensibleDataConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Order\EntityValue\AttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Order\EntityValue\CustomAttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Order\EntityValue\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\Order\AttributesProcessor + Opengento\Gdpr\Service\Export\Processor\Order\CustomAttributesProcessor + Opengento\Gdpr\Service\Export\Processor\Order\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\Order\StrategyProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Order\EntityIterator + Opengento\Gdpr\Service\Export\Processor\Order\Document + + + + + Opengento\Gdpr\Service\Export\Processor\Order\DataCollector + + + + + + + gdpr/export/subscriber_attributes + + + + + gdpr/export/subscriber_custom_attributes + + + + + gdpr/export/subscriber_extensible_data + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\Document + Opengento\Gdpr\Service\Export\Processor\Subscriber\Config\AttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\Document + Opengento\Gdpr\Service\Export\Processor\Subscriber\Config\CustomAttributesConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\Document + Opengento\Gdpr\Service\Export\Processor\Subscriber\Config\ExtensibleDataConfig + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\EntityValue\AttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\EntityValue\CustomAttributesProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\EntityValue\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\AttributesProcessor + Opengento\Gdpr\Service\Export\Processor\Subscriber\CustomAttributesProcessor + Opengento\Gdpr\Service\Export\Processor\Subscriber\ExtensibleDataProcessor + + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\StrategyProcessor + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\EntityIterator + Opengento\Gdpr\Service\Export\Processor\Subscriber\Document + + + + + Opengento\Gdpr\Service\Export\Processor\Subscriber\DataCollector + + diff --git a/view/frontend/templates/messages/popup.phtml b/view/frontend/templates/messages/popup.phtml index 4947e5e..822b098 100644 --- a/view/frontend/templates/messages/popup.phtml +++ b/view/frontend/templates/messages/popup.phtml @@ -11,7 +11,7 @@ From 902840d852d707fe3ae53cc4e3895afff195bd19 Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Fri, 26 Apr 2019 18:02:33 +0200 Subject: [PATCH 04/75] phpcsfix + split html renderer --- Cron/Erasure.php | 6 +- Model/Config.php | 8 +- Model/Config/ErasureComponentStrategy.php | 2 +- Model/Config/Source/ExportRenderer.php | 2 +- Model/EraseCustomerRepository.php | 3 +- Service/Export/Renderer/HtmlRenderer.php | 118 +-------------- .../Renderer/HtmlRenderer/LayoutInitiator.php | 143 ++++++++++++++++++ .../HtmlRenderer/LayoutInitiatorInterface.php | 23 +++ etc/di.xml | 8 +- 9 files changed, 190 insertions(+), 123 deletions(-) create mode 100644 Service/Export/Renderer/HtmlRenderer/LayoutInitiator.php create mode 100644 Service/Export/Renderer/HtmlRenderer/LayoutInitiatorInterface.php diff --git a/Cron/Erasure.php b/Cron/Erasure.php index 0a97516..0355134 100755 --- a/Cron/Erasure.php +++ b/Cron/Erasure.php @@ -54,7 +54,7 @@ final class Erasure private $searchCriteriaBuilder; /** - * @var \Magento\Framework\Stdlib\DateTime\DateTime + * @var \Magento\Framework\Stdlib\DateTime\DateTime */ private $dateTime; @@ -117,8 +117,8 @@ public function execute(): void private function retrieveEraseCustomerList(): SearchResultsInterface { $this->searchCriteriaBuilder->addFilter( - EraseCustomerInterface::SCHEDULED_AT, - $this->dateTime->date(), + EraseCustomerInterface::SCHEDULED_AT, + $this->dateTime->date(), 'lteq' ); $this->searchCriteriaBuilder->addFilter( diff --git a/Model/Config.php b/Model/Config.php index c2956c8..6ba4594 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -211,8 +211,7 @@ private function getValueString( string $path, string $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, string $scopeCode = '' - ): string - { + ): string { return (string) $this->scopeConfig->getValue($path, $scopeType, $scopeCode ?: null); } @@ -228,10 +227,9 @@ private function getValueArray( string $path, string $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, string $scopeCode = '' - ): array - { + ): array { $value = $this->scopeConfig->getValue($path, $scopeType, $scopeCode ?: null); - return $value ? \explode(',', $value) : []; + return $value ? \explode(',', $value) : []; } } diff --git a/Model/Config/ErasureComponentStrategy.php b/Model/Config/ErasureComponentStrategy.php index d915640..6ee2c39 100644 --- a/Model/Config/ErasureComponentStrategy.php +++ b/Model/Config/ErasureComponentStrategy.php @@ -86,7 +86,7 @@ public function getAnonymizeComponentsNames(): array /** * Retrieve the delete components names - * + * * @return string[] */ public function getDeleteComponentsNames(): array diff --git a/Model/Config/Source/ExportRenderer.php b/Model/Config/Source/ExportRenderer.php index 05bc550..5d2f31d 100644 --- a/Model/Config/Source/ExportRenderer.php +++ b/Model/Config/Source/ExportRenderer.php @@ -41,7 +41,7 @@ public function __construct( public function toOptionArray(): array { if (!$this->options) { - foreach ($this->retrieveRenderers() as $rendererName => $renderer) { + foreach (\array_keys($this->retrieveRenderers()) as $rendererName) { $this->options[] = ['label' => new Phrase($rendererName), 'value' => $rendererName]; } } diff --git a/Model/EraseCustomerRepository.php b/Model/EraseCustomerRepository.php index 90b9e8c..2a93298 100644 --- a/Model/EraseCustomerRepository.php +++ b/Model/EraseCustomerRepository.php @@ -177,7 +177,8 @@ public function delete(EraseCustomerInterface $entity): bool $this->eraseCustomerResource->delete($entity); } catch (\Exception $e) { throw new CouldNotDeleteException( - new Phrase('Could not delete entity with id "%1".', [$entity->getEntityId()]), $e + new Phrase('Could not delete entity with id "%1".', [$entity->getEntityId()]), + $e ); } diff --git a/Service/Export/Renderer/HtmlRenderer.php b/Service/Export/Renderer/HtmlRenderer.php index 2aac5dc..ba4bf5a 100644 --- a/Service/Export/Renderer/HtmlRenderer.php +++ b/Service/Export/Renderer/HtmlRenderer.php @@ -8,57 +8,23 @@ namespace Opengento\Gdpr\Service\Export\Renderer; use Magento\Framework\DataObject; -use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Filesystem; -use Magento\Framework\Phrase; use Magento\Framework\Translate\InlineInterface; use Magento\Framework\View\FileSystem as ViewFileSystem; -use Magento\Framework\View\Layout\BuilderFactory; -use Magento\Framework\View\Layout\GeneratorPool; -use Magento\Framework\View\Layout\ReaderPool; -use Magento\Framework\View\LayoutFactory; -use Magento\Framework\View\LayoutInterface; use Magento\Framework\View\Page\Config; use Magento\Framework\View\Page\Config\RendererFactory; -use Magento\Framework\View\Page\Layout\Reader; use Opengento\Gdpr\Service\Export\AbstractRenderer; +use Opengento\Gdpr\Service\Export\Renderer\HtmlRenderer\LayoutInitiatorInterface; /** * Class HtmlRenderer */ final class HtmlRenderer extends AbstractRenderer { - private const DEFAULT_LAYOUT_HANDLE = 'customer_privacy_export_personal_data'; - - /** - * @var \Magento\Framework\View\LayoutFactory - */ - private $layoutFactory; - - /** - * @var \Magento\Framework\View\Layout\BuilderFactory - */ - private $layoutBuilderFactory; - - /** - * @var \Magento\Framework\View\Layout\ReaderPool - */ - private $layoutReaderPool; - /** - * @var \Magento\Framework\View\Layout\GeneratorPool + * @var \Opengento\Gdpr\Service\Export\Renderer\HtmlRenderer\LayoutInitiatorInterface */ - private $layoutGeneratorPool; - - /** - * @var \Magento\Framework\View\Page\Layout\Reader - */ - private $pageLayoutReader; - - /** - * @var \Magento\Framework\View\Page\Config - */ - private $pageConfig; + private $layoutInitiator; /** * @var \Magento\Framework\View\Page\Config\Renderer @@ -82,11 +48,7 @@ final class HtmlRenderer extends AbstractRenderer /** * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\View\LayoutFactory $layoutFactory - * @param \Magento\Framework\View\Layout\BuilderFactory $layoutBuilderFactory - * @param \Magento\Framework\View\Layout\ReaderPool $layoutReaderPool - * @param \Magento\Framework\View\Layout\GeneratorPool $layoutGeneratorPool - * @param \Magento\Framework\View\Page\Layout\Reader $pageLayoutReader + * @param \Opengento\Gdpr\Service\Export\Renderer\HtmlRenderer\LayoutInitiatorInterface $layoutInitiator * @param \Magento\Framework\View\Page\Config $pageConfig * @param \Magento\Framework\View\Page\Config\RendererFactory $pageConfigRendererFactory * @param \Magento\Framework\Translate\InlineInterface $translateInline @@ -95,23 +57,14 @@ final class HtmlRenderer extends AbstractRenderer */ public function __construct( Filesystem $filesystem, - LayoutFactory $layoutFactory, - BuilderFactory $layoutBuilderFactory, - ReaderPool $layoutReaderPool, - GeneratorPool $layoutGeneratorPool, - Reader $pageLayoutReader, + LayoutInitiatorInterface $layoutInitiator, Config $pageConfig, RendererFactory $pageConfigRendererFactory, InlineInterface $translateInline, ViewFileSystem $viewFileSystem, string $template ) { - $this->layoutFactory = $layoutFactory; - $this->layoutBuilderFactory = $layoutBuilderFactory; - $this->layoutReaderPool = $layoutReaderPool; - $this->layoutGeneratorPool = $layoutGeneratorPool; - $this->pageLayoutReader = $pageLayoutReader; - $this->pageConfig = $pageConfig; + $this->layoutInitiator = $layoutInitiator; $this->pageConfigRenderer = $pageConfigRendererFactory->create(['pageConfig' => $pageConfig]); $this->translateInline = $translateInline; $this->viewFileSystem = $viewFileSystem; @@ -125,7 +78,7 @@ public function __construct( */ public function render(array $data): string { - $layout = $this->initLayout(); + $layout = $this->layoutInitiator->createLayout(); $addBlock = $layout->getBlock('head.additional'); $requireJs = $layout->getBlock('require.js'); @@ -173,61 +126,4 @@ private function renderPage(array $viewVars): string return \ob_get_clean(); } - - /** - * Add the default configuration to the page layout - * - * @param \Magento\Framework\View\LayoutInterface $layout - * @return \Magento\Framework\View\LayoutInterface - * @throws \Magento\Framework\Exception\LocalizedException - */ - private function addConfigLayout(LayoutInterface $layout): LayoutInterface - { - $this->layoutBuilderFactory->create( - BuilderFactory::TYPE_PAGE, - [ - 'layout' => $layout, - 'pageConfig' => $this->pageConfig, - 'pageLayoutReader' => $this->pageLayoutReader, - ] - )->build(); - - /** @var \Magento\Framework\View\Model\Layout\Merge $update */ - $update = $layout->getUpdate(); - $pageLayout = $this->pageConfig->getPageLayout() ?: $update->getPageLayout(); - - if (!$pageLayout) { - throw new LocalizedException(new Phrase('Page layout is missing.')); - } - - $this->pageConfig->addBodyClass(\str_replace('_', '-', self::DEFAULT_LAYOUT_HANDLE)); - $this->pageConfig->addBodyClass('page-layout-' . $pageLayout); - - return $layout; - } - - /** - * Init the page layout instructions - * - * @return \Magento\Framework\View\LayoutInterface - * @throws \Magento\Framework\Exception\LocalizedException - */ - private function initLayout(): LayoutInterface - { - $layout = $this->layoutFactory->create([ - 'cacheable' => false, - 'reader' => $this->layoutReaderPool, - 'generatorPool' => $this->layoutGeneratorPool, - ]); - - $layout->getUpdate()->addHandle('default'); - $layout->getUpdate()->addHandle(self::DEFAULT_LAYOUT_HANDLE); - /** @var \Magento\Framework\View\Model\Layout\Merge $update */ - $update = $layout->getUpdate(); - if ($update->isLayoutDefined()) { - $update->removeHandle('default'); - } - - return $this->addConfigLayout($layout); - } } diff --git a/Service/Export/Renderer/HtmlRenderer/LayoutInitiator.php b/Service/Export/Renderer/HtmlRenderer/LayoutInitiator.php new file mode 100644 index 0000000..62bb066 --- /dev/null +++ b/Service/Export/Renderer/HtmlRenderer/LayoutInitiator.php @@ -0,0 +1,143 @@ +layoutFactory = $layoutFactory; + $this->layoutBuilderFactory = $layoutBuilderFactory; + $this->layoutReaderPool = $layoutReaderPool; + $this->layoutGeneratorPool = $layoutGeneratorPool; + $this->pageLayoutReader = $pageLayoutReader; + $this->pageConfig = $pageConfig; + $this->defaultLayoutHandle = $defaultLayoutHandle; + } + + /** + * Create and initialize the page layout instructions + * + * @return \Magento\Framework\View\LayoutInterface + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function createLayout(): LayoutInterface + { + $layout = $this->layoutFactory->create([ + 'cacheable' => false, + 'reader' => $this->layoutReaderPool, + 'generatorPool' => $this->layoutGeneratorPool, + ]); + + $layout->getUpdate()->addHandle('default'); + $layout->getUpdate()->addHandle($this->defaultLayoutHandle); + /** @var \Magento\Framework\View\Model\Layout\Merge $update */ + $update = $layout->getUpdate(); + if ($update->isLayoutDefined()) { + $update->removeHandle('default'); + } + + return $this->addConfigLayout($layout); + } + + /** + * Add the default configuration to the page layout + * + * @param \Magento\Framework\View\LayoutInterface $layout + * @return \Magento\Framework\View\LayoutInterface + * @throws \Magento\Framework\Exception\LocalizedException + */ + private function addConfigLayout(LayoutInterface $layout): LayoutInterface + { + $this->layoutBuilderFactory->create( + BuilderFactory::TYPE_PAGE, + [ + 'layout' => $layout, + 'pageConfig' => $this->pageConfig, + 'pageLayoutReader' => $this->pageLayoutReader, + ] + )->build(); + + /** @var \Magento\Framework\View\Model\Layout\Merge $update */ + $update = $layout->getUpdate(); + $pageLayout = $this->pageConfig->getPageLayout() ?: $update->getPageLayout(); + + if (!$pageLayout) { + throw new LocalizedException(new Phrase('Page layout is missing.')); + } + + $this->pageConfig->addBodyClass(\str_replace('_', '-', $this->defaultLayoutHandle)); + $this->pageConfig->addBodyClass('page-layout-' . $pageLayout); + + return $layout; + } +} diff --git a/Service/Export/Renderer/HtmlRenderer/LayoutInitiatorInterface.php b/Service/Export/Renderer/HtmlRenderer/LayoutInitiatorInterface.php new file mode 100644 index 0000000..0d961e1 --- /dev/null +++ b/Service/Export/Renderer/HtmlRenderer/LayoutInitiatorInterface.php @@ -0,0 +1,23 @@ + - + pageConfigRenderPool pageLayoutGeneratorPool + customer_privacy_export_personal_data + + + + + Opengento\Gdpr\Service\Export\Renderer\HtmlRenderer\LayoutInitiator Magento_Theme::root.phtml From d30ad208401afba96e4b28848646482e617e7740 Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Fri, 26 Apr 2019 18:03:37 +0200 Subject: [PATCH 05/75] rwrite inheritdoc phpdoc --- Block/Messages/PrivacyMessagePopup.php | 4 +-- Console/Command/EraseCommand.php | 4 +-- Console/Command/ExportCommand.php | 4 +-- Controller/Privacy/Delete.php | 2 +- Controller/Privacy/DeletePost.php | 2 +- Controller/Privacy/Export.php | 2 +- Controller/Privacy/Settings.php | 2 +- Controller/Privacy/UndoDelete.php | 2 +- Model/Archive/Zip.php | 4 +-- Model/Config/Source/EraseStrategy.php | 2 +- Model/Config/Source/ErasureComponents.php | 2 +- Model/Config/Source/ExportRenderer.php | 2 +- .../Source/VirtualCustomerAttributes.php | 2 +- Model/Entity/EntityIterator.php | 2 +- .../EntityValue/CustomAttributesProcessor.php | 2 +- Model/Entity/EntityValue/DefaultProcessor.php | 2 +- .../EntityValue/ExtensibleDataProcessor.php | 2 +- .../Entity/EntityValue/StrategyProcessor.php | 2 +- Model/EraseCustomer.php | 26 +++++++++---------- Model/EraseCustomerManagement.php | 12 ++++----- Model/EraseCustomerRepository.php | 12 ++++----- Model/ResourceModel/EraseCustomer.php | 2 +- .../EraseCustomer/Collection.php | 2 +- .../CustomerAddressDataProcessor.php | 2 +- .../Processor/CustomerDataProcessor.php | 2 +- Service/Anonymize/Processor/Entity/Config.php | 2 +- .../Entity/EntityValue/Processor.php | 2 +- .../Processor/OrderDataProcessor.php | 2 +- .../Processor/QuoteDataProcessor.php | 2 +- .../Processor/SubscriberDataProcessor.php | 2 +- .../CustomerAddressDataProcessor.php | 2 +- .../Processor/CustomerDataProcessor.php | 2 +- .../Delete/Processor/OrderDataProcessor.php | 2 +- .../Delete/Processor/QuoteDataProcessor.php | 2 +- .../Processor/SubscriberDataProcessor.php | 2 +- Service/Export/AbstractRenderer.php | 2 +- .../CustomerAddressDataProcessor.php | 2 +- .../Processor/CustomerDataProcessor.php | 2 +- Service/Export/Processor/Entity/Config.php | 2 +- .../Export/Processor/Entity/DataCollector.php | 2 +- Service/Export/Processor/Entity/Document.php | 6 ++--- .../Entity/EntityValue/Processor.php | 2 +- .../Export/Processor/OrderDataProcessor.php | 2 +- .../Export/Processor/QuoteDataProcessor.php | 2 +- .../Processor/SubscriberDataProcessor.php | 2 +- Service/Export/Renderer/CsvRenderer.php | 2 +- Service/Export/Renderer/HtmlRenderer.php | 2 +- Service/Export/Renderer/JsonRenderer.php | 2 +- Service/Export/Renderer/PdfRenderer.php | 2 +- Service/Export/Renderer/XmlRenderer.php | 2 +- Service/ExportStrategy.php | 4 +-- Setup/InstallSchema.php | 2 +- Setup/Uninstall.php | 2 +- 53 files changed, 82 insertions(+), 82 deletions(-) diff --git a/Block/Messages/PrivacyMessagePopup.php b/Block/Messages/PrivacyMessagePopup.php index d730c01..e0d0fe5 100644 --- a/Block/Messages/PrivacyMessagePopup.php +++ b/Block/Messages/PrivacyMessagePopup.php @@ -60,7 +60,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function getJsLayout(): string { @@ -74,7 +74,7 @@ public function getJsLayout(): string } /** - * {@inheritdoc} + * @inheritdoc */ protected function _toHtml(): string { diff --git a/Console/Command/EraseCommand.php b/Console/Command/EraseCommand.php index bf8e338..463861c 100644 --- a/Console/Command/EraseCommand.php +++ b/Console/Command/EraseCommand.php @@ -62,7 +62,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ protected function configure(): void { @@ -79,7 +79,7 @@ protected function configure(): void } /** - * {@inheritdoc} + * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/Console/Command/ExportCommand.php b/Console/Command/ExportCommand.php index d1f8190..366f015 100644 --- a/Console/Command/ExportCommand.php +++ b/Console/Command/ExportCommand.php @@ -65,7 +65,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ protected function configure(): void { @@ -89,7 +89,7 @@ protected function configure(): void } /** - * {@inheritdoc} + * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/Controller/Privacy/Delete.php b/Controller/Privacy/Delete.php index 8235c19..8ddf4d3 100755 --- a/Controller/Privacy/Delete.php +++ b/Controller/Privacy/Delete.php @@ -45,7 +45,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function execute() { diff --git a/Controller/Privacy/DeletePost.php b/Controller/Privacy/DeletePost.php index d2d2abc..1dfb9be 100755 --- a/Controller/Privacy/DeletePost.php +++ b/Controller/Privacy/DeletePost.php @@ -66,7 +66,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function execute() { diff --git a/Controller/Privacy/Export.php b/Controller/Privacy/Export.php index 9e893d6..b60a252 100755 --- a/Controller/Privacy/Export.php +++ b/Controller/Privacy/Export.php @@ -93,7 +93,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function execute() { diff --git a/Controller/Privacy/Settings.php b/Controller/Privacy/Settings.php index 8311c0b..d55d243 100755 --- a/Controller/Privacy/Settings.php +++ b/Controller/Privacy/Settings.php @@ -16,7 +16,7 @@ class Settings extends AbstractPrivacy { /** - * {@inheritdoc} + * @inheritdoc */ public function execute() { diff --git a/Controller/Privacy/UndoDelete.php b/Controller/Privacy/UndoDelete.php index 96e1e93..0ebabdb 100755 --- a/Controller/Privacy/UndoDelete.php +++ b/Controller/Privacy/UndoDelete.php @@ -45,7 +45,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function execute() { diff --git a/Model/Archive/Zip.php b/Model/Archive/Zip.php index 21362e0..6ae2d06 100644 --- a/Model/Archive/Zip.php +++ b/Model/Archive/Zip.php @@ -40,7 +40,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function pack($source, $destination): string { @@ -55,7 +55,7 @@ public function pack($source, $destination): string } /** - * {@inheritdoc} + * @inheritdoc */ public function unpack($source, $destination): string { diff --git a/Model/Config/Source/EraseStrategy.php b/Model/Config/Source/EraseStrategy.php index 5508974..df5b27d 100644 --- a/Model/Config/Source/EraseStrategy.php +++ b/Model/Config/Source/EraseStrategy.php @@ -17,7 +17,7 @@ class EraseStrategy implements OptionSourceInterface { /** - * {@inheritdoc} + * @inheritdoc */ public function toOptionArray(): array { diff --git a/Model/Config/Source/ErasureComponents.php b/Model/Config/Source/ErasureComponents.php index e8b9539..a07ed76 100644 --- a/Model/Config/Source/ErasureComponents.php +++ b/Model/Config/Source/ErasureComponents.php @@ -36,7 +36,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function toOptionArray(): array { diff --git a/Model/Config/Source/ExportRenderer.php b/Model/Config/Source/ExportRenderer.php index 5d2f31d..fd4bbf8 100644 --- a/Model/Config/Source/ExportRenderer.php +++ b/Model/Config/Source/ExportRenderer.php @@ -36,7 +36,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function toOptionArray(): array { diff --git a/Model/Config/Source/VirtualCustomerAttributes.php b/Model/Config/Source/VirtualCustomerAttributes.php index b81cfc1..a5b0802 100644 --- a/Model/Config/Source/VirtualCustomerAttributes.php +++ b/Model/Config/Source/VirtualCustomerAttributes.php @@ -39,7 +39,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function toOptionArray(): array { diff --git a/Model/Entity/EntityIterator.php b/Model/Entity/EntityIterator.php index 525d8b7..492681a 100644 --- a/Model/Entity/EntityIterator.php +++ b/Model/Entity/EntityIterator.php @@ -37,7 +37,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function iterate($entity): void { diff --git a/Model/Entity/EntityValue/CustomAttributesProcessor.php b/Model/Entity/EntityValue/CustomAttributesProcessor.php index 797895d..d0f9e41 100644 --- a/Model/Entity/EntityValue/CustomAttributesProcessor.php +++ b/Model/Entity/EntityValue/CustomAttributesProcessor.php @@ -30,7 +30,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function process($entity, string $key, $value): void { diff --git a/Model/Entity/EntityValue/DefaultProcessor.php b/Model/Entity/EntityValue/DefaultProcessor.php index e4854f6..627acea 100644 --- a/Model/Entity/EntityValue/DefaultProcessor.php +++ b/Model/Entity/EntityValue/DefaultProcessor.php @@ -29,7 +29,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function process($entity, string $key, $value): void { diff --git a/Model/Entity/EntityValue/ExtensibleDataProcessor.php b/Model/Entity/EntityValue/ExtensibleDataProcessor.php index 1eb2753..162faed 100644 --- a/Model/Entity/EntityValue/ExtensibleDataProcessor.php +++ b/Model/Entity/EntityValue/ExtensibleDataProcessor.php @@ -30,7 +30,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function process($entity, string $key, $value): void { diff --git a/Model/Entity/EntityValue/StrategyProcessor.php b/Model/Entity/EntityValue/StrategyProcessor.php index 28fe920..0e3a23a 100644 --- a/Model/Entity/EntityValue/StrategyProcessor.php +++ b/Model/Entity/EntityValue/StrategyProcessor.php @@ -33,7 +33,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function process($entity, string $key, $value): void { diff --git a/Model/EraseCustomer.php b/Model/EraseCustomer.php index 371ae79..abca122 100755 --- a/Model/EraseCustomer.php +++ b/Model/EraseCustomer.php @@ -17,7 +17,7 @@ final class EraseCustomer extends AbstractExtensibleModel implements EraseCustomerInterface { /** - * {@inheritdoc} + * @inheritdoc */ protected function _construct(): void { @@ -25,7 +25,7 @@ protected function _construct(): void } /** - * {@inheritdoc} + * @inheritdoc */ public function getEntityId(): int { @@ -33,7 +33,7 @@ public function getEntityId(): int } /** - * {@inheritdoc} + * @inheritdoc */ public function setEntityId($entityId): EraseCustomerInterface { @@ -43,7 +43,7 @@ public function setEntityId($entityId): EraseCustomerInterface } /** - * {@inheritdoc} + * @inheritdoc */ public function getCustomerId(): int { @@ -51,7 +51,7 @@ public function getCustomerId(): int } /** - * {@inheritdoc} + * @inheritdoc */ public function setCustomerId(int $customerId): EraseCustomerInterface { @@ -59,7 +59,7 @@ public function setCustomerId(int $customerId): EraseCustomerInterface } /** - * {@inheritdoc} + * @inheritdoc */ public function getScheduledAt(): string { @@ -67,7 +67,7 @@ public function getScheduledAt(): string } /** - * {@inheritdoc} + * @inheritdoc */ public function setScheduledAt(string $scheduledAt): EraseCustomerInterface { @@ -75,7 +75,7 @@ public function setScheduledAt(string $scheduledAt): EraseCustomerInterface } /** - * {@inheritdoc} + * @inheritdoc */ public function getState(): string { @@ -83,7 +83,7 @@ public function getState(): string } /** - * {@inheritdoc} + * @inheritdoc */ public function setState(string $state): EraseCustomerInterface { @@ -91,7 +91,7 @@ public function setState(string $state): EraseCustomerInterface } /** - * {@inheritdoc} + * @inheritdoc */ public function getStatus(): string { @@ -99,7 +99,7 @@ public function getStatus(): string } /** - * {@inheritdoc} + * @inheritdoc */ public function setStatus(string $status): EraseCustomerInterface { @@ -107,7 +107,7 @@ public function setStatus(string $status): EraseCustomerInterface } /** - * {@inheritdoc} + * @inheritdoc */ public function getErasedAt(): string { @@ -115,7 +115,7 @@ public function getErasedAt(): string } /** - * {@inheritdoc} + * @inheritdoc */ public function setErasedAt(string $erasedAt): EraseCustomerInterface { diff --git a/Model/EraseCustomerManagement.php b/Model/EraseCustomerManagement.php index 3a0e173..8601d49 100644 --- a/Model/EraseCustomerManagement.php +++ b/Model/EraseCustomerManagement.php @@ -71,7 +71,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function create(int $customerId): EraseCustomerInterface { @@ -90,7 +90,7 @@ public function create(int $customerId): EraseCustomerInterface } /** - * {@inheritdoc} + * @inheritdoc */ public function cancel(int $customerId): bool { @@ -106,7 +106,7 @@ public function cancel(int $customerId): bool } /** - * {@inheritdoc} + * @inheritdoc */ public function process(EraseCustomerInterface $entity): EraseCustomerInterface { @@ -134,7 +134,7 @@ public function process(EraseCustomerInterface $entity): EraseCustomerInterface } /** - * {@inheritdoc} + * @inheritdoc */ public function exists(int $customerId): bool { @@ -147,7 +147,7 @@ public function exists(int $customerId): bool } /** - * {@inheritdoc} + * @inheritdoc */ public function canBeCanceled(EraseCustomerInterface $entity): bool { @@ -156,7 +156,7 @@ public function canBeCanceled(EraseCustomerInterface $entity): bool } /** - * {@inheritdoc} + * @inheritdoc */ public function canBeProcessed(EraseCustomerInterface $entity): bool { diff --git a/Model/EraseCustomerRepository.php b/Model/EraseCustomerRepository.php index 2a93298..6459ab7 100644 --- a/Model/EraseCustomerRepository.php +++ b/Model/EraseCustomerRepository.php @@ -83,7 +83,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function save(EraseCustomerInterface $entity): EraseCustomerInterface { @@ -100,7 +100,7 @@ public function save(EraseCustomerInterface $entity): EraseCustomerInterface } /** - * {@inheritdoc} + * @inheritdoc */ public function getById(int $entityId, bool $forceReload = false): EraseCustomerInterface { @@ -121,7 +121,7 @@ public function getById(int $entityId, bool $forceReload = false): EraseCustomer } /** - * {@inheritdoc} + * @inheritdoc */ public function getByCustomerId(int $entityId, bool $forceReload = false): EraseCustomerInterface { @@ -144,7 +144,7 @@ public function getByCustomerId(int $entityId, bool $forceReload = false): Erase } /** - * {@inheritdoc} + * @inheritdoc */ public function getList(SearchCriteriaInterface $searchCriteria): SearchResultsInterface { @@ -163,7 +163,7 @@ public function getList(SearchCriteriaInterface $searchCriteria): SearchResultsI } /** - * {@inheritdoc} + * @inheritdoc */ public function delete(EraseCustomerInterface $entity): bool { @@ -186,7 +186,7 @@ public function delete(EraseCustomerInterface $entity): bool } /** - * {@inheritdoc} + * @inheritdoc */ public function deleteById(int $entityId): bool { diff --git a/Model/ResourceModel/EraseCustomer.php b/Model/ResourceModel/EraseCustomer.php index ce26cde..0704e94 100755 --- a/Model/ResourceModel/EraseCustomer.php +++ b/Model/ResourceModel/EraseCustomer.php @@ -18,7 +18,7 @@ final class EraseCustomer extends AbstractDb public const TABLE = 'opengento_gdpr_erase_customer'; /** - * {@inheritdoc} + * @inheritdoc */ protected function _construct(): void { diff --git a/Model/ResourceModel/EraseCustomer/Collection.php b/Model/ResourceModel/EraseCustomer/Collection.php index d7176b7..5500af7 100755 --- a/Model/ResourceModel/EraseCustomer/Collection.php +++ b/Model/ResourceModel/EraseCustomer/Collection.php @@ -18,7 +18,7 @@ final class Collection extends AbstractCollection { /** - * {@inheritdoc} + * @inheritdoc */ protected function _construct(): void { diff --git a/Service/Anonymize/Processor/CustomerAddressDataProcessor.php b/Service/Anonymize/Processor/CustomerAddressDataProcessor.php index 04eccc2..afdaf96 100644 --- a/Service/Anonymize/Processor/CustomerAddressDataProcessor.php +++ b/Service/Anonymize/Processor/CustomerAddressDataProcessor.php @@ -48,7 +48,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Magento\Framework\Exception\LocalizedException */ public function execute(int $customerId): bool diff --git a/Service/Anonymize/Processor/CustomerDataProcessor.php b/Service/Anonymize/Processor/CustomerDataProcessor.php index 18a3398..d9417e9 100644 --- a/Service/Anonymize/Processor/CustomerDataProcessor.php +++ b/Service/Anonymize/Processor/CustomerDataProcessor.php @@ -77,7 +77,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Magento\Framework\Exception\LocalizedException */ public function execute(int $customerId): bool diff --git a/Service/Anonymize/Processor/Entity/Config.php b/Service/Anonymize/Processor/Entity/Config.php index 9ef9cc7..2c776ec 100644 --- a/Service/Anonymize/Processor/Entity/Config.php +++ b/Service/Anonymize/Processor/Entity/Config.php @@ -45,7 +45,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function getAttributes(?string $scopeCode = null): array { diff --git a/Service/Anonymize/Processor/Entity/EntityValue/Processor.php b/Service/Anonymize/Processor/Entity/EntityValue/Processor.php index af5aa60..a2cb35c 100644 --- a/Service/Anonymize/Processor/Entity/EntityValue/Processor.php +++ b/Service/Anonymize/Processor/Entity/EntityValue/Processor.php @@ -30,7 +30,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function process($entity, string $key, $value): void { diff --git a/Service/Anonymize/Processor/OrderDataProcessor.php b/Service/Anonymize/Processor/OrderDataProcessor.php index def7059..e38a2f4 100644 --- a/Service/Anonymize/Processor/OrderDataProcessor.php +++ b/Service/Anonymize/Processor/OrderDataProcessor.php @@ -59,7 +59,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Magento\Framework\Exception\LocalizedException */ public function execute(int $customerId): bool diff --git a/Service/Anonymize/Processor/QuoteDataProcessor.php b/Service/Anonymize/Processor/QuoteDataProcessor.php index 4feadff..7b49dd8 100644 --- a/Service/Anonymize/Processor/QuoteDataProcessor.php +++ b/Service/Anonymize/Processor/QuoteDataProcessor.php @@ -58,7 +58,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Exception */ public function execute(int $customerId): bool diff --git a/Service/Anonymize/Processor/SubscriberDataProcessor.php b/Service/Anonymize/Processor/SubscriberDataProcessor.php index 1b20963..dd1794d 100644 --- a/Service/Anonymize/Processor/SubscriberDataProcessor.php +++ b/Service/Anonymize/Processor/SubscriberDataProcessor.php @@ -48,7 +48,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Exception */ public function execute(int $customerId): bool diff --git a/Service/Delete/Processor/CustomerAddressDataProcessor.php b/Service/Delete/Processor/CustomerAddressDataProcessor.php index 6a6a5a5..760910a 100644 --- a/Service/Delete/Processor/CustomerAddressDataProcessor.php +++ b/Service/Delete/Processor/CustomerAddressDataProcessor.php @@ -39,7 +39,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Magento\Framework\Exception\LocalizedException */ public function execute(int $customerId): bool diff --git a/Service/Delete/Processor/CustomerDataProcessor.php b/Service/Delete/Processor/CustomerDataProcessor.php index 737d239..65db866 100644 --- a/Service/Delete/Processor/CustomerDataProcessor.php +++ b/Service/Delete/Processor/CustomerDataProcessor.php @@ -31,7 +31,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Magento\Framework\Exception\LocalizedException */ public function execute(int $customerId): bool diff --git a/Service/Delete/Processor/OrderDataProcessor.php b/Service/Delete/Processor/OrderDataProcessor.php index 6e41b87..ce3fd00 100644 --- a/Service/Delete/Processor/OrderDataProcessor.php +++ b/Service/Delete/Processor/OrderDataProcessor.php @@ -40,7 +40,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function execute(int $customerId): bool { diff --git a/Service/Delete/Processor/QuoteDataProcessor.php b/Service/Delete/Processor/QuoteDataProcessor.php index b0f07c4..7fdf7c3 100644 --- a/Service/Delete/Processor/QuoteDataProcessor.php +++ b/Service/Delete/Processor/QuoteDataProcessor.php @@ -39,7 +39,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function execute(int $customerId): bool { diff --git a/Service/Delete/Processor/SubscriberDataProcessor.php b/Service/Delete/Processor/SubscriberDataProcessor.php index ff20375..21077ab 100644 --- a/Service/Delete/Processor/SubscriberDataProcessor.php +++ b/Service/Delete/Processor/SubscriberDataProcessor.php @@ -39,7 +39,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Exception */ public function execute(int $customerId): bool diff --git a/Service/Export/AbstractRenderer.php b/Service/Export/AbstractRenderer.php index 0914365..a696946 100644 --- a/Service/Export/AbstractRenderer.php +++ b/Service/Export/AbstractRenderer.php @@ -38,7 +38,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Magento\Framework\Exception\FileSystemException */ public function saveData(string $fileName, array $data): string diff --git a/Service/Export/Processor/CustomerAddressDataProcessor.php b/Service/Export/Processor/CustomerAddressDataProcessor.php index 5281899..fa0e900 100644 --- a/Service/Export/Processor/CustomerAddressDataProcessor.php +++ b/Service/Export/Processor/CustomerAddressDataProcessor.php @@ -48,7 +48,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Magento\Framework\Exception\LocalizedException */ public function execute(int $customerId, array $data): array diff --git a/Service/Export/Processor/CustomerDataProcessor.php b/Service/Export/Processor/CustomerDataProcessor.php index a2ae8fa..ecdf681 100644 --- a/Service/Export/Processor/CustomerDataProcessor.php +++ b/Service/Export/Processor/CustomerDataProcessor.php @@ -39,7 +39,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Magento\Framework\Exception\NoSuchEntityException * @throws \Magento\Framework\Exception\LocalizedException */ diff --git a/Service/Export/Processor/Entity/Config.php b/Service/Export/Processor/Entity/Config.php index cea9f9c..d3687e0 100644 --- a/Service/Export/Processor/Entity/Config.php +++ b/Service/Export/Processor/Entity/Config.php @@ -45,7 +45,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function getAttributes(?string $scopeCode = null): array { diff --git a/Service/Export/Processor/Entity/DataCollector.php b/Service/Export/Processor/Entity/DataCollector.php index 0dbe661..293b68b 100644 --- a/Service/Export/Processor/Entity/DataCollector.php +++ b/Service/Export/Processor/Entity/DataCollector.php @@ -37,7 +37,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function collect($entity): array { diff --git a/Service/Export/Processor/Entity/Document.php b/Service/Export/Processor/Entity/Document.php index de3b7df..751d1d4 100644 --- a/Service/Export/Processor/Entity/Document.php +++ b/Service/Export/Processor/Entity/Document.php @@ -26,7 +26,7 @@ public function __construct(array $data = []) } /** - * {@inheritdoc} + * @inheritdoc */ public function setData(array $data): void { @@ -34,7 +34,7 @@ public function setData(array $data): void } /** - * {@inheritdoc} + * @inheritdoc */ public function addData(string $key, $value): void { @@ -42,7 +42,7 @@ public function addData(string $key, $value): void } /** - * {@inheritdoc} + * @inheritdoc */ public function getData(): array { diff --git a/Service/Export/Processor/Entity/EntityValue/Processor.php b/Service/Export/Processor/Entity/EntityValue/Processor.php index c9ae77d..4cfdc97 100644 --- a/Service/Export/Processor/Entity/EntityValue/Processor.php +++ b/Service/Export/Processor/Entity/EntityValue/Processor.php @@ -39,7 +39,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function process($entity, string $key, $value): void { diff --git a/Service/Export/Processor/OrderDataProcessor.php b/Service/Export/Processor/OrderDataProcessor.php index 7bc5a7d..289b02d 100644 --- a/Service/Export/Processor/OrderDataProcessor.php +++ b/Service/Export/Processor/OrderDataProcessor.php @@ -49,7 +49,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function execute(int $customerId, array $data): array { diff --git a/Service/Export/Processor/QuoteDataProcessor.php b/Service/Export/Processor/QuoteDataProcessor.php index b88bc69..7403e7e 100644 --- a/Service/Export/Processor/QuoteDataProcessor.php +++ b/Service/Export/Processor/QuoteDataProcessor.php @@ -48,7 +48,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function execute(int $customerId, array $data): array { diff --git a/Service/Export/Processor/SubscriberDataProcessor.php b/Service/Export/Processor/SubscriberDataProcessor.php index 2115152..3c66fe3 100644 --- a/Service/Export/Processor/SubscriberDataProcessor.php +++ b/Service/Export/Processor/SubscriberDataProcessor.php @@ -39,7 +39,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function execute(int $customerId, array $data): array { diff --git a/Service/Export/Renderer/CsvRenderer.php b/Service/Export/Renderer/CsvRenderer.php index 6e3cfe6..92fc985 100644 --- a/Service/Export/Renderer/CsvRenderer.php +++ b/Service/Export/Renderer/CsvRenderer.php @@ -25,7 +25,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function render(array $data): string { diff --git a/Service/Export/Renderer/HtmlRenderer.php b/Service/Export/Renderer/HtmlRenderer.php index ba4bf5a..103597e 100644 --- a/Service/Export/Renderer/HtmlRenderer.php +++ b/Service/Export/Renderer/HtmlRenderer.php @@ -73,7 +73,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Exception */ public function render(array $data): string diff --git a/Service/Export/Renderer/JsonRenderer.php b/Service/Export/Renderer/JsonRenderer.php index c49ea33..b79021d 100644 --- a/Service/Export/Renderer/JsonRenderer.php +++ b/Service/Export/Renderer/JsonRenderer.php @@ -34,7 +34,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function render(array $data): string { diff --git a/Service/Export/Renderer/PdfRenderer.php b/Service/Export/Renderer/PdfRenderer.php index 2a6402c..77818f7 100644 --- a/Service/Export/Renderer/PdfRenderer.php +++ b/Service/Export/Renderer/PdfRenderer.php @@ -42,7 +42,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Exception */ public function render(array $data): string diff --git a/Service/Export/Renderer/XmlRenderer.php b/Service/Export/Renderer/XmlRenderer.php index 4dcc4b3..6fe24d6 100644 --- a/Service/Export/Renderer/XmlRenderer.php +++ b/Service/Export/Renderer/XmlRenderer.php @@ -34,7 +34,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @throws \Magento\Framework\Exception\LocalizedException */ public function render(array $data): string diff --git a/Service/ExportStrategy.php b/Service/ExportStrategy.php index 01aabb1..8acca7b 100644 --- a/Service/ExportStrategy.php +++ b/Service/ExportStrategy.php @@ -45,7 +45,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function render(array $data): string { @@ -53,7 +53,7 @@ public function render(array $data): string } /** - * {@inheritdoc} + * @inheritdoc */ public function saveData(string $fileName, array $data): string { diff --git a/Setup/InstallSchema.php b/Setup/InstallSchema.php index f2350b8..a20e356 100755 --- a/Setup/InstallSchema.php +++ b/Setup/InstallSchema.php @@ -21,7 +21,7 @@ final class InstallSchema implements InstallSchemaInterface { /** - * {@inheritdoc} + * @inheritdoc * @throws \Zend_Db_Exception */ public function install(SchemaSetupInterface $setup, ModuleContextInterface $context): void diff --git a/Setup/Uninstall.php b/Setup/Uninstall.php index 38732b6..d39fe29 100644 --- a/Setup/Uninstall.php +++ b/Setup/Uninstall.php @@ -19,7 +19,7 @@ final class Uninstall implements UninstallInterface { /** - * {@inheritdoc} + * @inheritdoc */ public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context): void { From 08410dd88bfaf3bddc94988c58ad47d335107fab Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Thu, 2 May 2019 18:00:12 +0200 Subject: [PATCH 06/75] replace hydrator by pool --- Model/Entity/EntityIterator.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Model/Entity/EntityIterator.php b/Model/Entity/EntityIterator.php index 492681a..49583e0 100644 --- a/Model/Entity/EntityIterator.php +++ b/Model/Entity/EntityIterator.php @@ -7,7 +7,7 @@ namespace Opengento\Gdpr\Model\Entity; -use Magento\Framework\EntityManager\HydratorInterface; +use Magento\Framework\EntityManager\HydratorPool; /** * Class EntityIterator @@ -15,9 +15,9 @@ class EntityIterator implements EntityIteratorInterface { /** - * @var \Magento\Framework\EntityManager\HydratorInterface + * @var \Magento\Framework\EntityManager\HydratorPool */ - private $hydrator; + private $hydratorPool; /** * @var \Opengento\Gdpr\Model\Entity\EntityValueProcessorInterface @@ -25,14 +25,14 @@ class EntityIterator implements EntityIteratorInterface private $processor; /** - * @param \Magento\Framework\EntityManager\HydratorInterface $hydrator + * @param \Magento\Framework\EntityManager\HydratorPool $hydratorPool * @param \Opengento\Gdpr\Model\Entity\EntityValueProcessorInterface $processor */ public function __construct( - HydratorInterface $hydrator, + HydratorPool $hydratorPool, EntityValueProcessorInterface $processor ) { - $this->hydrator = $hydrator; + $this->hydratorPool = $hydratorPool; $this->processor = $processor; } @@ -41,7 +41,7 @@ public function __construct( */ public function iterate($entity): void { - foreach ($this->hydrator->extract($entity) as $key => $value) { + foreach ($this->hydratorPool->getHydrator($entity)->extract($entity) as $key => $value) { $this->processor->process($entity, $key, $value); } } From 7d7394a8a0afc26897038d762187cf21eccb7c9b Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Thu, 2 May 2019 18:01:04 +0200 Subject: [PATCH 07/75] add attributes config --- etc/adminhtml/system/export.xml | 90 ++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 24 deletions(-) diff --git a/etc/adminhtml/system/export.xml b/etc/adminhtml/system/export.xml index df97af2..41bda6b 100644 --- a/etc/adminhtml/system/export.xml +++ b/etc/adminhtml/system/export.xml @@ -6,17 +6,17 @@ */ --> - + 1 - + Magento\Config\Model\Config\Source\Enabledisable gdpr/export/enabled - + Magento\Cms\Model\Config\Source\Block @@ -24,7 +24,7 @@ gdpr/export/block_id - + Opengento\Gdpr\Model\Config\Source\ExportRenderer @@ -32,25 +32,67 @@ gdpr/export/renderer - - - This attributes list will be exported when processed. - Opengento\Gdpr\Model\Config\Source\CustomerAttributes - 1 - - 1 - - gdpr/export/customer_attributes - - - - This address attributes list will be exported when processed. - Opengento\Gdpr\Model\Config\Source\CustomerAddressAttributes - 1 - - 1 - - gdpr/export/customer_address_attributes - + + + + + This attributes list will be exported when processed. + Opengento\Gdpr\Model\Config\Source\CustomerAttributes + 1 + + 1 + + gdpr/export/customer_attributes + + + + + + + This address attributes list will be exported when processed. + Opengento\Gdpr\Model\Config\Source\CustomerAddressAttributes + 1 + + 1 + + gdpr/export/customer_address_attributes + + + + + + + Attributes must be separated with comma. + 1 + + 1 + + gdpr/export/quote_attributes + + + + + + + Attributes must be separated with comma. + 1 + + 1 + + gdpr/export/order_attributes + + + + + + + Attributes must be separated with comma. + 1 + + 1 + + gdpr/export/subscriber_attributes + + From 95020e8680a0f406c8881c3bc43f61f105082695 Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Fri, 3 May 2019 10:44:41 +0200 Subject: [PATCH 08/75] fix issue #11 - cookie popin does not show --- Block/Messages/PrivacyMessagePopup.php | 4 +--- view/frontend/layout/default.xml | 1 + view/frontend/templates/messages/popup.phtml | 4 ++-- view/frontend/web/css/source/_module.less | 4 ++++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Block/Messages/PrivacyMessagePopup.php b/Block/Messages/PrivacyMessagePopup.php index e0d0fe5..d961f2d 100644 --- a/Block/Messages/PrivacyMessagePopup.php +++ b/Block/Messages/PrivacyMessagePopup.php @@ -49,9 +49,7 @@ public function __construct( Config $config, HelperPage $helperPage, Json $jsonSerializer, - array $data = [ - 'template' => 'Opengento_Gdpr::messages/popup.phtml', - ] + array $data = [] ) { $this->config = $config; $this->helperPage = $helperPage; diff --git a/view/frontend/layout/default.xml b/view/frontend/layout/default.xml index ff65e66..c26837c 100644 --- a/view/frontend/layout/default.xml +++ b/view/frontend/layout/default.xml @@ -10,6 +10,7 @@ + Opengento_Gdpr::messages/popup.phtml diff --git a/view/frontend/templates/messages/popup.phtml b/view/frontend/templates/messages/popup.phtml index 822b098..a440e03 100644 --- a/view/frontend/templates/messages/popup.phtml +++ b/view/frontend/templates/messages/popup.phtml @@ -5,12 +5,12 @@ */ /** @var \Opengento\Gdpr\Block\Messages\PrivacyMessagePopup $block */ ?> -