| @@ 514-525 (lines=12) @@ | ||
| 511 | * @param string $key |
|
| 512 | * @param mixed $value |
|
| 513 | */ |
|
| 514 | protected function setMappedAttribute($key, $value) |
|
| 515 | { |
|
| 516 | $segments = explode('.', $this->getMappingForAttribute($key)); |
|
| 517 | ||
| 518 | $attribute = array_pop($segments); |
|
| 519 | ||
| 520 | if ($target = $this->getTarget($this, $segments)) { |
|
| 521 | $this->addTargetToSave($target); |
|
| 522 | ||
| 523 | $target->{$attribute} = $value; |
|
| 524 | } |
|
| 525 | } |
|
| 526 | ||
| 527 | /** |
|
| 528 | * Flag mapped model to be saved along with this model. |
|
| @@ 559-568 (lines=10) @@ | ||
| 556 | * @param string $key |
|
| 557 | * @return void |
|
| 558 | */ |
|
| 559 | protected function forget($key) |
|
| 560 | { |
|
| 561 | $mapping = $this->getMappingForAttribute($key); |
|
| 562 | ||
| 563 | list($target, $attribute) = $this->parseMappedColumn($mapping); |
|
| 564 | ||
| 565 | $target = $target ? $this->getTarget($this, explode('.', $target)) : $this; |
|
| 566 | ||
| 567 | unset($target->{$attribute}); |
|
| 568 | } |
|
| 569 | ||
| 570 | /** |
|
| 571 | * @codeCoverageIgnore |
|