Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
stevie-mayhew authored Mar 21, 2017
2 parents c008cf5 + da45ca9 commit 3d7efe0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions code/DataObjectExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ public function onBeforeWrite()
continue;
}

$value = (string) $value['after'];

list($hasOne, $key) = explode(self::SEPARATOR, $name, 2);

if ($this->owner->hasOne($hasOne)) {
$rel = $this->owner->getComponent($hasOne);
$value = (string)$value['after'];
list($hasone, $key) = explode(self::separator, $name, 2);
if($this->owner->has_one($hasone) || $this->owner->belongs_to($hasone)) {
$rel = $this->owner->getComponent($hasone);

// Get original:
$original = (string) $rel->__get($key);
Expand Down

0 comments on commit 3d7efe0

Please sign in to comment.