| @@ 188-192 (lines=5) @@ | ||
| 185 | */ |
|
| 186 | public function setAttribute($key, $value) |
|
| 187 | { |
|
| 188 | if (str_contains($key, ':')) { |
|
| 189 | list($key, $locale) = explode(':', $key); |
|
| 190 | } else { |
|
| 191 | $locale = $this->locale(); |
|
| 192 | } |
|
| 193 | ||
| 194 | if ($this->isTranslationAttribute($key)) { |
|
| 195 | $this->getTranslationOrNew($locale)->$key = $value; |
|
| @@ 156-160 (lines=5) @@ | ||
| 153 | */ |
|
| 154 | public function getAttribute($key) |
|
| 155 | { |
|
| 156 | if (str_contains($key, ':')) { |
|
| 157 | list($key, $locale) = explode(':', $key); |
|
| 158 | } else { |
|
| 159 | $locale = $this->locale(); |
|
| 160 | } |
|
| 161 | ||
| 162 | if ($this->isTranslationAttribute($key)) { |
|
| 163 | if ($this->getTranslation($locale) === null) { |
|