diff --git a/src/lib/Data/Content/ContentUpdateData.php b/src/lib/Data/Content/ContentUpdateData.php index 86fa84b0..548db3da 100644 --- a/src/lib/Data/Content/ContentUpdateData.php +++ b/src/lib/Data/Content/ContentUpdateData.php @@ -9,13 +9,15 @@ namespace Ibexa\ContentForms\Data\Content; use Ibexa\ContentForms\Data\NewnessCheckable; +use Ibexa\ContentForms\Data\VersionInfoAwareInterface; use Ibexa\Core\Repository\Values\Content\ContentUpdateStruct; +use Ibexa\Core\Repository\Values\Content\VersionInfo; /** * @property \Ibexa\Contracts\ContentForms\Data\Content\FieldData[] $fieldsData * @property \Ibexa\Contracts\Core\Repository\Values\Content\Content $contentDraft */ -class ContentUpdateData extends ContentUpdateStruct implements NewnessCheckable +class ContentUpdateData extends ContentUpdateStruct implements NewnessCheckable, VersionInfoAwareInterface { use ContentData; @@ -25,6 +27,11 @@ public function isNew() { return false; } + + public function getVersionInfo(): VersionInfo + { + return $this->contentDraft->versionInfo; + } } class_alias(ContentUpdateData::class, 'EzSystems\EzPlatformContentForms\Data\Content\ContentUpdateData'); diff --git a/src/lib/Data/User/UserUpdateData.php b/src/lib/Data/User/UserUpdateData.php index d7b3f63d..5a9bd05e 100644 --- a/src/lib/Data/User/UserUpdateData.php +++ b/src/lib/Data/User/UserUpdateData.php @@ -10,13 +10,15 @@ use Ibexa\ContentForms\Data\Content\ContentData; use Ibexa\ContentForms\Data\NewnessCheckable; +use Ibexa\ContentForms\Data\VersionInfoAwareInterface; use Ibexa\Contracts\Core\Repository\Values\User\UserUpdateStruct; +use Ibexa\Core\Repository\Values\Content\VersionInfo; /** * @property \Ibexa\Contracts\ContentForms\Data\Content\FieldData[] $fieldsData * @property \Ibexa\Contracts\Core\Repository\Values\User\User $user */ -class UserUpdateData extends UserUpdateStruct implements NewnessCheckable +class UserUpdateData extends UserUpdateStruct implements NewnessCheckable, VersionInfoAwareInterface { use ContentData; @@ -34,6 +36,11 @@ public function isNew() { return false; } + + public function getVersionInfo(): VersionInfo + { + return $this->user->versionInfo; + } } class_alias(UserUpdateData::class, 'EzSystems\EzPlatformContentForms\Data\User\UserUpdateData'); diff --git a/src/lib/Data/VersionInfoAwareInterface.php b/src/lib/Data/VersionInfoAwareInterface.php new file mode 100644 index 00000000..aefb274a --- /dev/null +++ b/src/lib/Data/VersionInfoAwareInterface.php @@ -0,0 +1,16 @@ +