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

Classification

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

class

Classification

Classification.php:32

How sensitive the data of an entity, or of one of its properties, is (ISO/IEC 27001 A.5.12, A.5.13): public, interne (the default), personnel (data about a person: a name, an address, a birth date) or sante (health data: a lesion, a certificate, an occupational disease). Read by tArrayProperties into the classification keyword of the schemas, and answered by Schema::classificationOf (one property) and Schema::getClassification (the entity, its most sensitive property included).

#[Attribute(9)] class MMO\core\attributes\Classification
Espace de noms
MMO\core\attributes
On a class, it is the level of the entity and the default of its properties; on a property, that property's level. A class without one inherits its parent's. A virtual property (an #[ArrayProperty] on the class) takes it in its schema: `#[ArrayProperty(name: 'age', getter: 'getAge', schema: ['classification' => 'personnel'])]`. What masks, logs, encrypts, anonymises or marks data (an export's « Confidentiel » footer) reads it from there.
#[Classification('personnel')] class Employee extends Entity { #[ArrayProperty] protected string $name = ''; // personnel, the class's #[Classification('sante')] #[ArrayProperty] protected array $lesions = []; // sante #[Classification('interne')] #[ArrayProperty] protected string $team = ''; // interne } Employee::Schema()->classificationOf('lesions'); // 'sante' Employee::Schema()->getClassification(); // 'sante': the most sensitive of the entity

Index

DEFAULTthe level of what declares none
HEALTH
INTERNAL
LEVELSthe levels, from the least sensitive to the most
PERSONAL
PUBLIC
level readonly
Check($level) static
IsPersonal($level) static
Marking($level) staticThe marking of a document holding data of $level (ISO/IEC 27001 A.5.13): its footer, translated in the current language.
Max($levels) static
OfClass($class) staticThe class-level classification of $class: its own attribute, else its nearest parent's
Rank($level) static
__construct($level)

Constantes6

DEFAULT

the level of what declares none

const DEFAULT = 'interne'

HEALTH

const HEALTH = 'sante'

INTERNAL

const INTERNAL = 'interne'

LEVELS

the levels, from the least sensitive to the most

const LEVELS = ['public', 'interne', 'personnel', 'sante']

PERSONAL

const PERSONAL = 'personnel'

PUBLIC

const PUBLIC = 'public'

Propriétés1

level

readonly
readonly string $level
Type
string

Méthodes7

Check($level)

staticClassification.php:55
static function Check(string $level): string
$levelstring
retournestring$level, when it is one of LEVELS
lèveotherwise
Classification::Check('sante'); // 'sante'

IsPersonal($level)

staticClassification.php:89
static function IsPersonal(string $level): bool
$levelstring
retournebooltrue for data about a person (personnel and sante): what is masked, logged when read, and marked
Classification::IsPersonal('sante'); // true

Marking($level)

staticClassification.php:100

The marking of a document holding data of $level (ISO/IEC 27001 A.5.13): its footer, translated in the current language. What an export (xlsx, pdf) of a collection prints (RepositoryController::routeGet).

static function Marking(string $level): ?string
$levelstringone of LEVELS
retournenull | stringnull when $level needs none (public, interne)
Classification::Marking('sante'); // 'Confidentiel — données de santé' in French

Max($levels)

staticClassification.php:76
static function Max(string ...$levels): string
...$levelsstring
retournestringthe most sensitive of $levels, DEFAULT when there is none
Classification::Max('interne', 'sante', 'personnel'); // 'sante'

OfClass($class)

staticClassification.php:115

The class-level classification of $class: its own attribute, else its nearest parent's

static function OfClass(string $class): ?string
$classstring
retournenull | stringnull when neither $class nor its parents declare one
Classification::OfClass(Employee::class); // 'personnel'

Rank($level)

staticClassification.php:67
static function Rank(string $level): int
$levelstringone of LEVELS
retourneintits rank in LEVELS: 0 for public to 3 for sante
Classification::Rank('personnel') > Classification::Rank('interne'); // true