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