PersonalData
in package
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
$detect read-only
public
bool
$detect
= false
$kind read-only
public
PersonalDataKind
$kind
Methods
__construct()
public
__construct(PersonalDataKind $kind[, bool $detect = false ]) : mixed
Parameters
- $kind : PersonalDataKind
- $detect : bool = false
-
truewhen the field is personal data only if it contains some, e.g. the generic advert parametervalue(a price for one parameter, a contact e-mail for another); withEmailonly the addresses inside it are masked