Skip to content

Commit

Permalink
Merge pull request #6 from wernerkrauss/patch-1
Browse files Browse the repository at this point in the history
Ability to write to a $belongs_to relation
  • Loading branch information
stevie-mayhew authored Mar 21, 2017
2 parents 46b841a + df833fb commit da45ca9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/DataObjectExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function onBeforeWrite() {
}
$value = (string)$value['after'];
list($hasone, $key) = explode(self::separator, $name, 2);
if($this->owner->has_one($hasone)) {
if($this->owner->has_one($hasone) || $this->owner->belongs_to($hasone)) {
$rel = $this->owner->getComponent($hasone);

// Get original:
Expand Down

0 comments on commit da45ca9

Please sign in to comment.