| @@ 522-533 (lines=12) @@ | ||
| 519 | * @param string $key |
|
| 520 | * @param mixed $value |
|
| 521 | */ |
|
| 522 | protected function setMappedAttribute($key, $value) |
|
| 523 | { |
|
| 524 | $segments = explode('.', $this->getMappingForAttribute($key)); |
|
| 525 | ||
| 526 | $attribute = array_pop($segments); |
|
| 527 | ||
| 528 | if ($target = $this->getTarget($this, $segments)) { |
|
| 529 | $this->addTargetToSave($target); |
|
| 530 | ||
| 531 | $target->{$attribute} = $value; |
|
| 532 | } |
|
| 533 | } |
|
| 534 | ||
| 535 | /** |
|
| 536 | * Flag mapped model to be saved along with this model. |
|
| @@ 567-576 (lines=10) @@ | ||
| 564 | * @param string $key |
|
| 565 | * @return void |
|
| 566 | */ |
|
| 567 | protected function forget($key) |
|
| 568 | { |
|
| 569 | $mapping = $this->getMappingForAttribute($key); |
|
| 570 | ||
| 571 | list($target, $attribute) = $this->parseMappedColumn($mapping); |
|
| 572 | ||
| 573 | $target = $target ? $this->getTarget($this, explode('.', $target)) : $this; |
|
| 574 | ||
| 575 | unset($target->{$attribute}); |
|
| 576 | } |
|
| 577 | ||
| 578 | /** |
|
| 579 | * @codeCoverageIgnore |
|