| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| 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 | $encryptedValue = $this->getEncryptedField()->encryptValue($value); |
||
| 32 | return $encryptedValue; |
||
| 33 | } |
||
| 53 |