| Conditions | 6 |
| Paths | 6 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | private function setValue( |
||
|
|
|||
| 10 | string $name, |
||
| 11 | $bind = null, |
||
| 12 | $default = null, |
||
| 13 | $language = null |
||
| 14 | ) { |
||
| 15 | if ($this->isWired()) { |
||
| 16 | return; |
||
| 17 | } |
||
| 18 | |||
| 19 | if (!$language) { |
||
| 20 | $default = $this->getBoundValue($bind, $name) ?: $default; |
||
| 21 | |||
| 22 | return $this->value = old($name, $default); |
||
| 23 | } |
||
| 24 | |||
| 25 | $bind = $this->getBoundTarget($bind, $name); |
||
| 26 | |||
| 27 | if ($bind) { |
||
| 28 | $default = $bind->getTranslation($name, $language, false) ?: $default; |
||
| 29 | } |
||
| 30 | |||
| 31 | $this->value = old("{$name}.{$language}", $default); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |