diff --git a/src/Extension/BaseElementExtension.php b/src/Extension/BaseElementExtension.php index b2bb432..b041607 100644 --- a/src/Extension/BaseElementExtension.php +++ b/src/Extension/BaseElementExtension.php @@ -20,11 +20,6 @@ class BaseElementExtension extends DataExtension { - /** - * @var mixed - */ - protected $virtualOwner; - /** * @config * @@ -60,7 +55,7 @@ public function populateDefaults() */ public function setVirtualOwner(ElementVirtual $owner) { - $this->virtualOwner = $owner; + $this->owner->setField('_virtualOwner', $owner); return $this; } @@ -69,7 +64,7 @@ public function setVirtualOwner(ElementVirtual $owner) */ public function getVirtualOwner() { - return $this->virtualOwner; + return $this->owner->getField('_virtualOwner'); } /** @@ -240,7 +235,7 @@ public function getUsage() if ($page = $this->owner->getPage()) { $usage->push($page); - if ($this->virtualOwner) { + if ($this->owner->getField('_virtualOwner')) { $page->setField('ElementType', 'Linked'); } else { $page->setField('ElementType', 'Master');