PHP code example of flurrybox / enhanced-privacy

1. Go to this page and download the library: Download flurrybox/enhanced-privacy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

flurrybox / enhanced-privacy example snippets


    

    declare(strict_types=1);

    namespace Vendor\Module\Privacy\Export;
    
    use Flurrybox\EnhancedPrivacy\Api\DataExportInterface;
    use Magento\Customer\Api\Data\CustomerInterface;
    
    class Entity implements DataExportInterface
    {
        /**
         * Executed upon exporting customer data.
         *
         * Expected return structure:
         *      array(
         *          array('HEADER1', 'HEADER2', 'HEADER3', ...),
         *          array('VALUE1', 'VALUE2', 'VALUE3', ...),
         *          ...
         *      )
         *
         * @param \Magento\Customer\Api\Data\CustomerInterface $customer
         *
         * @return array
         */
        public function export(CustomerInterface $customer)
        {
            ...
        }
    }
    

    
    
    declare(strict_types=1);
    
    namespace Vendor\Module\Privacy\Delete;
    
    use Flurrybox\EnhancedPrivacy\Api\DataDeleteInterface;
    use Magento\Customer\Api\Data\CustomerInterface;
    
    class Entity implements DataDeleteInterface
    {
        /**
         * Executed upon customer data deletion.
         *
         * @param \Magento\Customer\Api\Data\CustomerInterface $customer
         *
         * @return void
         */
        public function delete(CustomerInterface $customer)
        {
            ...
        }
        
        /**
         * Executed upon customer data anonymization.
         *
         * @param \Magento\Customer\Api\Data\CustomerInterface $customer
         *
         * @return void
         */
        public function anonymize(CustomerInterface $customer)
        {
            ...
        }
    }
    

composer magento module:enable Flurrybox_EnhancedPrivacy
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

    php bin/magento module:enable Flurrybox_EnhancedPrivacy
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy