| Conditions | 8 |
| Paths | 7 |
| Total Lines | 29 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 | $inputName = static::convertBracketsToDots($name); |
||
| 20 | |||
| 21 | if (!$language) { |
||
| 22 | $boundValue = $this->getBoundValue($bind, $name); |
||
| 23 | |||
| 24 | $default = is_null($boundValue) ? $default : $boundValue; |
||
| 25 | |||
| 26 | return $this->value = old($inputName, $default); |
||
| 27 | } |
||
| 28 | |||
| 29 | if ($bind !== false) { |
||
| 30 | $bind = $bind ?: $this->getBoundTarget(); |
||
| 31 | } |
||
| 32 | |||
| 33 | if ($bind) { |
||
| 34 | $default = $bind->getTranslation($name, $language, false) ?: $default; |
||
| 35 | } |
||
| 36 | |||
| 37 | $this->value = old("{$inputName}.{$language}", $default); |
||
| 38 | } |
||
| 40 |