| @@ 528-539 (lines=12) @@ | ||
| 525 | * @param string $key |
|
| 526 | * @param mixed $value |
|
| 527 | */ |
|
| 528 | protected function setMappedAttribute($key, $value) |
|
| 529 | { |
|
| 530 | $segments = explode('.', $this->getMappingForAttribute($key)); |
|
| 531 | ||
| 532 | $attribute = array_pop($segments); |
|
| 533 | ||
| 534 | if ($target = $this->getTarget($this, $segments)) { |
|
| 535 | $this->addTargetToSave($target); |
|
| 536 | ||
| 537 | $target->{$attribute} = $value; |
|
| 538 | } |
|
| 539 | } |
|
| 540 | ||
| 541 | /** |
|
| 542 | * Flag mapped model to be saved along with this model. |
|
| @@ 573-582 (lines=10) @@ | ||
| 570 | * @param string $key |
|
| 571 | * @return void |
|
| 572 | */ |
|
| 573 | protected function forget($key) |
|
| 574 | { |
|
| 575 | $mapping = $this->getMappingForAttribute($key); |
|
| 576 | ||
| 577 | list($target, $attribute) = $this->parseMappedColumn($mapping); |
|
| 578 | ||
| 579 | $target = $target ? $this->getTarget($this, explode('.', $target)) : $this; |
|
| 580 | ||
| 581 | unset($target->{$attribute}); |
|
| 582 | } |
|
| 583 | ||
| 584 | /** |
|
| 585 | * @codeCoverageIgnore |
|