MMOframework
Pourquoi l'IA Playground Bibliothèques Développeurs Agence
FR EN
Créer un projet en direct
Index

PersonalData

MMO\core\helpers · 1 symbole · générée le 30 Nov 2026

class

PersonalData

PersonalData.php:33

The data of a person, everywhere (ISO/IEC 27001 A.5.34, A.8.10; GDPR articles 15 and 17): her document and the documents that refer to her, found through the schemas -- a property whose entity is hers (Contrat::$salarie for a Salarie), followed again from the collections of $follow (a contract's accidents).

class MMO\core\helpers\PersonalData use MMO\core\classes\tSingleton
Espace de noms
MMO\core\helpers
Utilise les traits
tSingleton
- [`find`](https://mmoframework.fr/documentation/mmo.core/php/helpers/PersonalData.md#personaldata-find) lists them: collection, id, through which property, how far from the person; - [`export`](https://mmoframework.fr/documentation/mmo.core/php/helpers/PersonalData.md#personaldata-export) gives their data (the right of access), as the entities export it; - [`erase`](https://mmoframework.fr/documentation/mmo.core/php/helpers/PersonalData.md#personaldata-erase) is a simulation by default: it says what it would do to each one. Applied, the person's own document keeps its id and its references, and loses every value classified `personnel` or `sante` (its schema's `default`, else null, '' or []): what refers to her still does, and holds no more of her. A document that refers to her is treated as [`$erase`](https://mmoframework.fr/documentation/mmo.core/php/helpers/PersonalData.md#personaldata-erase) says of its collection: `anonymize` (the same, its own personal values blanked), `delete`, or `keep` (the default: listed only -- an accident declared to the CPAM is kept as long as the law asks). Every change goes through the entities and `\MMO\commit()` (the journal records each), and the report is written ([`Retention::writeReport`](https://mmoframework.fr/documentation/mmo.core/php/helpers/Retention.md#retention-writereport)): what was erased, where, can be checked afterwards.
// configs/config.json "MMO\\core\\helpers\\PersonalData": {"follow": ["contrats"], "erase": {"contrats": "anonymize", "accidentTravails": "keep"}} $report = PersonalData::Shared()->erase(\MMO\get('repository'), 'salaries', '68ef75da03db30e8bd043956'); // what it would do $report = PersonalData::Shared()->erase(\MMO\get('repository'), 'salaries', '68ef75da03db30e8bd043956', false); // done

Index

ANONYMIZE
DELETE
KEEP
depth
erase
follow
blank($entity, $dryRun)Blank the values of $entity classified personnel or sante; its references to other entities are kept
BlankOf($schema) static
erase($repository, $collection, $id, $dryRun)The right to erasure: what is done to each document of the person (find), a simulation by default
export($repository, $collection, $id)The right of access: the data of the person and of what refers to her, as their entities export it
find($repository, $person)The documents of the person, and those that refer to her
Instantiate($config) static(Re)create the shared instance immediately, configured with $config merged into the class's existing config.
IsShared() static
person($repository, $collection, $id)
Plain($value) static
referrers($repository, $entity)
Shared() staticGet the shared instance, creating (and configuring) it on first call.
Title($entity) static
Unshare($serialize) staticRemove the shared instance, so the next Shared() call creates a fresh one.

Constantes3

ANONYMIZE

const ANONYMIZE = 'anonymize'

DELETE

const DELETE = 'delete'

KEEP

const KEEP = 'keep'

Propriétés3

depth

int $depth = 3
Type
int

erase

array $erase = []
Type
array

follow

array $follow = []
Type
array

Méthodes13

blank($entity, $dryRun)

PersonalData.php:163

Blank the values of $entity classified personnel or sante; its references to other entities are kept

function blank(MMO\core\interfaces\iEntity $entity, bool $dryRun = true): array
$entityiEntity
$dryRun = trueboolonly say which
retournearraythe properties blanked (or to blank)

BlankOf($schema)

staticPersonalData.php:187
static function BlankOf(MMO\core\schemas\Schema $schema): mixed
$schemaSchemaa property's
retournemixedits value once erased: its default, else null when it may be, '' for a string, [] for an array or an object

erase($repository, $collection, $id, $dryRun)

PersonalData.php:133

The right to erasure: what is done to each document of the person (find), a simulation by default

function erase( MMO\core\interfaces\iRepository $repository, string $collection, string $id, bool $dryRun = true ): array
$repositoryiRepository
$collectionstring
$idstring
$dryRun = truebooltrue (the default): change nothing, say what would be done
retournearraystring, date: string, dryRun: bool, documents: list<array{collection: string, id: string, via: string, action: string, fields: list<string>}>, report: string|null}

export($repository, $collection, $id)

PersonalData.php:115

The right of access: the data of the person and of what refers to her, as their entities export it

function export( MMO\core\interfaces\iRepository $repository, string $collection, string $id ): array
$repositoryiRepository
$collectionstring
$idstring
retournearraystring, date: string, documents: list<array{collection: string, id: string, via: string, depth: int, data: array<string, mixed>}>}

find($repository, $person)

PersonalData.php:66

The documents of the person, and those that refer to her

function find( MMO\core\interfaces\iRepository $repository, MMO\core\interfaces\iEntity $person ): array
$repositoryiRepository
$personiEntity
retournearraystring, id: string, title: string, via: string, depth: int, entity: iEntity}> her own first (via empty, depth 0)

Instantiate($config)

statictSingleton.php:66

(Re)create the shared instance immediately, configured with $config merged into the class's existing config.

static function Instantiate(array $config = []): staticUnlike a plain [`Shared()`](https://mmoframework.fr/documentation/mmo.core/php/helpers/PersonalData.md#personaldata-shared) call (which lazily builds the instance from whatever config was already loaded), this lets you supply/override config right before the instance is built.
$config = []arrayconfig values merged in before the instance is constructed
retournestaticthe newly (re)created shared instance
MyService::Instantiate(['greeting' => 'yo'])->greeting; // 'yo'

IsShared()

statictSingleton.php:54
static function IsShared(): bool
retournebooltrue if the shared instance has already been created (a call to Shared() would not need to construct a new one)
MyService::IsShared(); // false until the first MyService::Shared() call

person($repository, $collection, $id)

PersonalData.php:54
function person( MMO\core\interfaces\iRepository $repository, string $collection, string $id ): MMO\core\interfaces\iEntity
$repositoryiRepository
$collectionstringthe person's collection
$idstringher document's id
retourneiEntity
lève

Plain($value)

staticPersonalData.php:209
protected static function Plain(mixed $value): mixed
$valuemixedan entity's export
retournemixedthe same, its objects as scalars (an entity as its uid, a date as ISO 8601)

referrers($repository, $entity)

PersonalData.php:92
protected function referrers( MMO\core\interfaces\iRepository $repository, MMO\core\interfaces\iEntity $entity ): array
$repositoryiRepository
$entityiEntity
retournearraystring, 1: string}> the collections and properties that may refer to $entity: a stored property whose entity is $entity's class (or a parent of it)

Shared()

statictSingleton.php:22

Get the shared instance, creating (and configuring) it on first call.

static function Shared(): static
retournestatic
MyService::Shared()->greeting; // 'hello'

Title($entity)

staticPersonalData.php:200
protected static function Title(MMO\core\interfaces\iEntity $entity): string
$entityiEntity
retournestringwhat names an entity in a listing: its title, else its uid

Unshare($serialize)

statictSingleton.php:40

Remove the shared instance, so the next Shared() call creates a fresh one.

static function Unshare(bool $serialize = true): bool
Voir
serialize) and kept as the class's config, so the next instance created picks up where this one left off; if false, the instance is simply discarded and the next one starts from the class's original config
$serialize = trueboolif true (the default) and an instance currently exists, it is serialized first (via
retournebooltrue if an instance actually existed and was removed
MyService::Unshare(); // true if MyService::Shared() had already been called; the next call rebuilds it