Conditions | 4 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public function setValue(mixed $value, null|array|ModelData $record = null, bool $markChanged = true): static |
||
39 | { |
||
40 | $this->setEncryptionAad($record); |
||
41 | |||
42 | // Return early if we keep encrypted value in memory |
||
43 | if (!EncryptHelper::getAutomaticDecryption()) { |
||
44 | $this->value = $value; |
||
45 | return $this; |
||
46 | } |
||
47 | |||
48 | // $markChanged is not used |
||
49 | // The value might come encrypted from the database |
||
50 | if ($value && EncryptHelper::isEncrypted($value)) { |
||
51 | $this->value = $this->decryptValue($value); |
||
52 | } else { |
||
53 | $this->value = $value; |
||
54 | } |
||
55 | return $this; |
||
56 | } |
||
58 |