-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #890 from afoucret/feature_gdpr_25
GDPR implementation
- Loading branch information
Showing
25 changed files
with
739 additions
and
118 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
src/module-elasticsuite-tracker/Api/CustomerTrackingServiceInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/** | ||
* DISCLAIMER | ||
* Do not edit or add to this file if you wish to upgrade Smile Elastic Suite to newer | ||
* versions in the future. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteTracker | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
* @copyright 2018 Smile | ||
* @license Open Software License ("OSL") v. 3.0 | ||
*/ | ||
namespace Smile\ElasticsuiteTracker\Api; | ||
|
||
/** | ||
* Customer Tracking Service interface. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteTracker | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
*/ | ||
interface CustomerTrackingServiceInterface | ||
{ | ||
/** | ||
* Add a tracked event. | ||
* | ||
* @param array $eventData The event Data | ||
* | ||
* @return mixed | ||
*/ | ||
public function addEvent($eventData); | ||
|
||
/** | ||
* Anonymize customer data for a given customer Id and a delay. | ||
* If the delay is null, the anonymization process is run immediately. | ||
* | ||
* @param int $customerId The customer Id. | ||
* @param \DateTime|null $delay The date after which all the customer data must be cleared. | ||
* | ||
* @return void | ||
*/ | ||
public function anonymizeCustomerData(int $customerId, \DateTime $delay = null); | ||
|
||
/** | ||
* Process cleaning of all expired customer data. | ||
* | ||
* @return void | ||
*/ | ||
public function deleteExpired(); | ||
|
||
/** | ||
* Retrieve all visitor ids matching a given customer | ||
* | ||
* @param int $customerId The customer id | ||
* | ||
* @return array | ||
*/ | ||
public function getVisitorIds(int $customerId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/module-elasticsuite-tracker/Cron/ExpireCustomerLink.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* DISCLAIMER | ||
* Do not edit or add to this file if you wish to upgrade Smile Elastic Suite to newer | ||
* versions in the future. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteTracker | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
* @copyright 2017 Smile | ||
* @license Open Software License ("OSL") v. 3.0 | ||
*/ | ||
namespace Smile\ElasticsuiteTracker\Cron; | ||
|
||
/** | ||
* Cronjob that will anonymize log events that have reached their "delete_after" date if the anonymization is enabled. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteTracker | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
*/ | ||
class ExpireCustomerLink | ||
{ | ||
/** | ||
* @var \Smile\ElasticsuiteTracker\Api\CustomerTrackingServiceInterface | ||
*/ | ||
private $trackingService; | ||
|
||
/** | ||
* @var \Smile\ElasticsuiteTracker\Helper\Data | ||
*/ | ||
private $helper; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param \Smile\ElasticsuiteTracker\Api\CustomerTrackingServiceInterface $trackingService Tracking service. | ||
* @param \Smile\ElasticsuiteTracker\Helper\Data $helper Tracking helper. | ||
*/ | ||
public function __construct( | ||
\Smile\ElasticsuiteTracker\Api\CustomerTrackingServiceInterface $trackingService, | ||
\Smile\ElasticsuiteTracker\Helper\Data $helper | ||
) { | ||
$this->trackingService = $trackingService; | ||
$this->helper = $helper; | ||
} | ||
|
||
/** | ||
* Perform the cleaning of the expired entries if necessary and if anonymization is enabled. | ||
*/ | ||
public function execute() | ||
{ | ||
if ($this->helper->isAnonymizationEnabled()) { | ||
$this->trackingService->deleteExpired(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.