Conditions | 5 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function prepValueForDB(mixed $value): array|string|null |
||
22 | { |
||
23 | if (!$value) { |
||
24 | if ($this->getNullifyEmpty() || $value === null) { |
||
|
|||
25 | return null; |
||
26 | } |
||
27 | return ''; |
||
28 | } |
||
29 | // Don't encrypt twice |
||
30 | if (EncryptHelper::isEncrypted($value)) { |
||
31 | return $value; |
||
32 | } |
||
33 | $aad = $this->encryptionAad; |
||
34 | $encryptedValue = $this->getEncryptedField()->encryptValue($value, $aad); |
||
35 | return $encryptedValue; |
||
36 | } |
||
58 |