PHP code example of morebec / orkestra-privacy

1. Go to this page and download the library: Download morebec/orkestra-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/ */

    

morebec / orkestra-privacy example snippets


use Morebec\Orkestra\Privacy\PersonalData;
 
$personalToken='usr123456';

$data = new PersonalData($personalToken, 'emailAddress' /* key */, '[email protected]' /* value */, 'registration_form' /* source */);
$data->disposedAt($clock->now()->addDays(15));

// You can use this reference token to reference this personal data within the store in your application code.
$referenceToken = $store->put($data);

$data = $store->findOneByReferenceToken($referenceToken);

// Data can also be retrieved in an number of ways:
$data = $store->findOneByKeyName('user123456', 'emailAddress'); 

// Returns an array of all personal data related to a personal token.
$data = $store->findByPersonalToken('user123456');


use Morebec\Orkestra\Privacy\PersonalData;
$data = new PersonalData('usr123456', 'emailAddress', '[email protected]', 'account_settings');

$referenceToken = $store->put($data);

use Morebec\Orkestra\Privacy\PersonalData;
$data = new PersonalData('usr123456', 'emailAddress', '[email protected]', 'account_settings');

$referenceToken = $store->replace($referenceToken, $data);

$store->removeByKeyName('user123456', 'emailAddress');

// Deletes all records for a given personal token.
$store->erase('user123456');

$remover->run(); // Will remove all disposable data as of the current date time.