CoolCMS API

PersonalData
in package

FinalYes

Marks a field that carries personal data, which a foreign unprivileged caller receives according to the global mode {@see PersonalDataExposure}.

The owner comes from PersonalDataOwner on the class; an entity with a marked field and no owner attribute behaves as if nobody owned it (admin-only data).

IMPORTANT: the mask is applied only when sending to the caller (PersonalDataPolicy), never in the hydrator. Its output sits in a query cache keyed independently of the caller, so an owner-dependent mask there would hand one user's data to another.

Usage:

#[PersonalData(PersonalDataKind::Email)]
protected string $email = '';
Attributes
#[Attribute]
\Attribute::TARGET_PROPERTY | \Attribute::TARGET_PARAMETER

Table of Contents

Properties

$detect  : bool
$kind  : PersonalDataKind

Methods

__construct()  : mixed

Properties

Methods

__construct()

public __construct(PersonalDataKind $kind[, bool $detect = false ]) : mixed
Parameters
$kind : PersonalDataKind
$detect : bool = false

true when the field is personal data only if it contains some, e.g. the generic advert parameter value (a price for one parameter, a contact e-mail for another); with Email only the addresses inside it are masked

On this page

Search results