diff --git a/code/DataObjectExtension.php b/code/DataObjectExtension.php index 8b5b44a..7754004 100644 --- a/code/DataObjectExtension.php +++ b/code/DataObjectExtension.php @@ -27,7 +27,7 @@ public function onBeforeWrite() } $value = (string)$value['after']; - list($hasone, $key) = explode(self::separator, $name, 2); + list($hasone, $key) = explode(self::SEPARATOR, $name, 2); if($this->owner->has_one($hasone) || $this->owner->belongs_to($hasone)) { $rel = $this->owner->getComponent($hasone); @@ -36,7 +36,7 @@ public function onBeforeWrite() if ($original !== $value) { $rel->setCastedField($key, $value); - $toWrite[$hasOne] = $rel; + $toWrite[$hasone] = $rel; } } }