FieldCipher
MMO\core\helpers · 1 symbole · générée le 30 Nov 2026
FieldCipher
FieldCipher.php:32The properties classified sante encrypted by the application before they are stored, and decrypted when they are read (ISO/IEC 27001 A.8.24): what the database, its dumps and its journal hold of them is ciphertext. Disabled by default ($enabled): nothing changes until a project turns it on, with its keys in place.
- Espace de noms
MMO\core\helpers- Utilise les traits
- tSingleton
Index
| PREFIX | ||
| createKey | ||
| enabled | ||
| fields | ||
| key | ||
| keyFolder | ||
| keys | ||
| resolved | ||
| decrypt($value) | ||
| decryptFields($data) | What a repository reads: every top-level value encrypted, decrypted (enabled or not) | |
| encrypt($value) | ||
| encryptFields($class, $data) | What a repository writes: the fields of $class encrypted, when $enabled | |
| fieldsOf($class) | ||
| Instantiate($config) static | (Re)create the shared instance immediately, configured with $config merged into the class's existing config. | |
| IsEncrypted($value) static | ||
| IsShared() static | ||
| KeyIdOf($value) static | ||
| keyOf($id, $create) | ||
| Plain($value) static | ||
| setKey($id, $key) | ||
| Shared() static | Get the shared instance, creating (and configuring) it on first call. | |
| Unshare($serialize) static | Remove the shared instance, so the next Shared() call creates a fresh one. |
Constantes1
PREFIX
Propriétés7
createKey
- Type
- bool
enabled
- Type
- bool
fields
- Type
- array
key
- Type
- string
keyFolder
- Type
- string
keys
- Type
- array
resolved
- Type
- array
Méthodes14
decrypt($value)
FieldCipher.php:112decryptFields($data)
FieldCipher.php:163What a repository reads: every top-level value encrypted, decrypted (enabled or not)
encrypt($value)
FieldCipher.php:90encryptFields($class, $data)
FieldCipher.php:150What a repository writes: the fields of $class encrypted, when $enabled
fieldsOf($class)
FieldCipher.php:126Instantiate($config)
statictSingleton.php:66(Re)create the shared instance immediately, configured with $config merged into the class's existing config.
| $config = [] | array | config values merged in before the instance is constructed |
| retourne | static | the newly (re)created shared instance |
IsEncrypted($value)
staticFieldCipher.php:98IsShared()
statictSingleton.php:54| retourne | bool | true if the shared instance has already been created (a call to Shared() would not need to construct a new one) |
KeyIdOf($value)
staticFieldCipher.php:103keyOf($id, $create)
FieldCipher.php:70Plain($value)
staticFieldCipher.php:174setKey($id, $key)
FieldCipher.php:58Shared()
statictSingleton.php:22Get the shared instance, creating (and configuring) it on first call.
| retourne | static |
Unshare($serialize)
statictSingleton.php:40Remove the shared instance, so the next Shared() call creates a fresh one.
- 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 = true | bool | if true (the default) and an instance currently exists, it is serialized first (via |
| retourne | bool | true if an instance actually existed and was removed |