From ca754a7160f7edadd8cbe143bf263e8a25d51fdf Mon Sep 17 00:00:00 2001 From: Martin Eiber Date: Mon, 9 Dec 2024 14:01:13 +0100 Subject: [PATCH] Add getLanguagePermissions --- src/Models/DataObject/DataObjectServiceResolver.php | 12 ++++++++++++ .../DataObjectServiceResolverInterface.php | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/src/Models/DataObject/DataObjectServiceResolver.php b/src/Models/DataObject/DataObjectServiceResolver.php index e2a13d7..daec97a 100644 --- a/src/Models/DataObject/DataObjectServiceResolver.php +++ b/src/Models/DataObject/DataObjectServiceResolver.php @@ -22,6 +22,9 @@ use Pimcore\Model\DataObject\Concrete; use Pimcore\Model\DataObject\Folder; use Pimcore\Model\DataObject\Service; +use Pimcore\Model\UserInterface; +use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData as FieldCollectionData; +use Pimcore\Model\DataObject\Objectbrick\Data\AbstractData as ObjectBrickData; /** * @internal @@ -78,4 +81,13 @@ public function getObjectsReferencingUser(int $userId): array { return Service::getObjectsReferencingUser($userId); } + + public function getLanguagePermissions( + FieldCollectionData|ObjectBrickData|AbstractObject $object, + UserInterface $user, + string $type + ): ?array + { + return Service::getLanguagePermissions($object, $user, $type); + } } diff --git a/src/Models/DataObject/DataObjectServiceResolverInterface.php b/src/Models/DataObject/DataObjectServiceResolverInterface.php index f26ee9c..b9f033e 100644 --- a/src/Models/DataObject/DataObjectServiceResolverInterface.php +++ b/src/Models/DataObject/DataObjectServiceResolverInterface.php @@ -19,7 +19,10 @@ use Pimcore\Model\DataObject\AbstractObject; use Pimcore\Model\DataObject\ClassDefinition; use Pimcore\Model\DataObject\Concrete; +use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData as FieldCollectionData; use Pimcore\Model\DataObject\Folder; +use Pimcore\Model\DataObject\Objectbrick\Data\AbstractData as ObjectBrickData; +use Pimcore\Model\UserInterface; /** * @internal @@ -50,4 +53,10 @@ public function enrichLayoutDefinition( * @return Concrete[] */ public function getObjectsReferencingUser(int $userId): array; + + public function getLanguagePermissions( + FieldCollectionData|ObjectBrickData|AbstractObject $object, + UserInterface $user, + string $type + ): ?array; }