diff --git a/src/CoreShop/Bundle/ResourceBundle/CoreExtension/CoreShopRelation.php b/src/CoreShop/Bundle/ResourceBundle/CoreExtension/CoreShopRelation.php index 08373b4f50..0a0af32116 100644 --- a/src/CoreShop/Bundle/ResourceBundle/CoreExtension/CoreShopRelation.php +++ b/src/CoreShop/Bundle/ResourceBundle/CoreExtension/CoreShopRelation.php @@ -28,8 +28,9 @@ class CoreShopRelation extends Data\ManyToOneRelation { public string|null $stack = null; - public bool $returnConcrete = false; + public bool $objectsAllowed = true; + public array $classes = []; public function getFieldType(): string { @@ -106,28 +107,13 @@ public function setClasses(array $classes): static return $this; } - public function getObjectsAllowed(): bool - { - return true; - } - public function getDocumentsAllowed(): bool + public static function __set_state(array $data): static { - return false; - } + $obj = parent::__set_state($data); + $obj->classes = $obj->getClasses(); + $obj->objectsAllowed = true; - public function getDocumentTypes(): array - { - return []; - } - - public function getAssetsAllowed(): bool - { - return false; - } - - public function getAssetTypes(): array - { - return []; + return $obj; } } diff --git a/src/CoreShop/Bundle/ResourceBundle/CoreExtension/CoreShopRelations.php b/src/CoreShop/Bundle/ResourceBundle/CoreExtension/CoreShopRelations.php index ae08e8b286..08dfb141b5 100644 --- a/src/CoreShop/Bundle/ResourceBundle/CoreExtension/CoreShopRelations.php +++ b/src/CoreShop/Bundle/ResourceBundle/CoreExtension/CoreShopRelations.php @@ -26,6 +26,8 @@ class CoreShopRelations extends Data\ManyToManyRelation { public string|null $stack; + public bool $objectsAllowed = true; + public array $classes = []; public function getFieldType(): string { @@ -102,28 +104,12 @@ public function getClasses(): array return $return; } - public function getObjectsAllowed(): bool + public static function __set_state(array $data): static { - return true; - } - - public function getDocumentsAllowed(): bool - { - return false; - } + $obj = parent::__set_state($data); + $obj->classes = $obj->getClasses(); + $obj->objectsAllowed = true; - public function getDocumentTypes(): array - { - return []; - } - - public function getAssetsAllowed(): bool - { - return false; - } - - public function getAssetTypes(): array - { - return []; + return $obj; } }