diff --git a/src/Sulu/Bundle/CategoryBundle/Infrastructure/Sulu/Content/PropertyResolver/Resolver/CategorySelectionPropertyResolver.php b/src/Sulu/Bundle/CategoryBundle/Infrastructure/Sulu/Content/PropertyResolver/Resolver/CategorySelectionPropertyResolver.php index 6f29cb0762e..9175895d623 100644 --- a/src/Sulu/Bundle/CategoryBundle/Infrastructure/Sulu/Content/PropertyResolver/Resolver/CategorySelectionPropertyResolver.php +++ b/src/Sulu/Bundle/CategoryBundle/Infrastructure/Sulu/Content/PropertyResolver/Resolver/CategorySelectionPropertyResolver.php @@ -17,6 +17,11 @@ use Sulu\Bundle\ContentBundle\Content\Application\ContentResolver\Value\ContentView; use Sulu\Bundle\ContentBundle\Content\Application\PropertyResolver\PropertyResolverInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class CategorySelectionPropertyResolver implements PropertyResolverInterface { public function resolve(mixed $data, string $locale, array $params = []): ContentView diff --git a/src/Sulu/Bundle/CategoryBundle/Infrastructure/Sulu/Content/ResourceLoader/CategoryResourceLoader.php b/src/Sulu/Bundle/CategoryBundle/Infrastructure/Sulu/Content/ResourceLoader/CategoryResourceLoader.php index a448ecae2a2..b0679f585c7 100644 --- a/src/Sulu/Bundle/CategoryBundle/Infrastructure/Sulu/Content/ResourceLoader/CategoryResourceLoader.php +++ b/src/Sulu/Bundle/CategoryBundle/Infrastructure/Sulu/Content/ResourceLoader/CategoryResourceLoader.php @@ -16,6 +16,11 @@ use Sulu\Bundle\CategoryBundle\Category\CategoryManagerInterface; use Sulu\Bundle\ContentBundle\Content\Application\ResourceLoader\ResourceLoaderInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class CategoryResourceLoader implements ResourceLoaderInterface { public const RESOURCE_LOADER_KEY = 'category'; diff --git a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/AccountSelectionPropertyResolver.php b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/AccountSelectionPropertyResolver.php index 78867b9a126..aa2c82bb42e 100644 --- a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/AccountSelectionPropertyResolver.php +++ b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/AccountSelectionPropertyResolver.php @@ -17,6 +17,11 @@ use Sulu\Bundle\ContentBundle\Content\Application\ContentResolver\Value\ContentView; use Sulu\Bundle\ContentBundle\Content\Application\PropertyResolver\PropertyResolverInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class AccountSelectionPropertyResolver implements PropertyResolverInterface { public function resolve(mixed $data, string $locale, array $params = []): ContentView diff --git a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/ContactAccountSelectionPropertyResolver.php b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/ContactAccountSelectionPropertyResolver.php index baceee0a8da..60476434689 100644 --- a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/ContactAccountSelectionPropertyResolver.php +++ b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/ContactAccountSelectionPropertyResolver.php @@ -19,6 +19,11 @@ use Sulu\Bundle\ContentBundle\Content\Application\ContentResolver\Value\ResolvableResource; use Sulu\Bundle\ContentBundle\Content\Application\PropertyResolver\PropertyResolverInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class ContactAccountSelectionPropertyResolver implements PropertyResolverInterface { public const PREFIX_CONTACT = 'c'; diff --git a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/ContactSelectionPropertyResolver.php b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/ContactSelectionPropertyResolver.php index 059f5160e21..675ea3837a9 100644 --- a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/ContactSelectionPropertyResolver.php +++ b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/ContactSelectionPropertyResolver.php @@ -17,6 +17,11 @@ use Sulu\Bundle\ContentBundle\Content\Application\ContentResolver\Value\ContentView; use Sulu\Bundle\ContentBundle\Content\Application\PropertyResolver\PropertyResolverInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class ContactSelectionPropertyResolver implements PropertyResolverInterface { public function resolve(mixed $data, string $locale, array $params = []): ContentView diff --git a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/SingleAccountSelectionPropertyResolver.php b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/SingleAccountSelectionPropertyResolver.php index 689e67f4750..b43d7127ee9 100644 --- a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/SingleAccountSelectionPropertyResolver.php +++ b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/SingleAccountSelectionPropertyResolver.php @@ -17,6 +17,11 @@ use Sulu\Bundle\ContentBundle\Content\Application\ContentResolver\Value\ContentView; use Sulu\Bundle\ContentBundle\Content\Application\PropertyResolver\PropertyResolverInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class SingleAccountSelectionPropertyResolver implements PropertyResolverInterface { public function resolve(mixed $data, string $locale, array $params = []): ContentView diff --git a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/SingleContactSelectionPropertyResolver.php b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/SingleContactSelectionPropertyResolver.php index a22af942a1e..0c2d730596f 100644 --- a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/SingleContactSelectionPropertyResolver.php +++ b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/PropertyResolver/SingleContactSelectionPropertyResolver.php @@ -17,6 +17,11 @@ use Sulu\Bundle\ContentBundle\Content\Application\ContentResolver\Value\ContentView; use Sulu\Bundle\ContentBundle\Content\Application\PropertyResolver\PropertyResolverInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class SingleContactSelectionPropertyResolver implements PropertyResolverInterface { public function resolve(mixed $data, string $locale, array $params = []): ContentView diff --git a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/ResourceLoader/AccountResourceLoader.php b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/ResourceLoader/AccountResourceLoader.php index a8e1c39e883..954ecc40b5d 100644 --- a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/ResourceLoader/AccountResourceLoader.php +++ b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/ResourceLoader/AccountResourceLoader.php @@ -19,6 +19,11 @@ use Sulu\Bundle\ContactBundle\Entity\AccountInterface; use Sulu\Bundle\ContentBundle\Content\Application\ResourceLoader\ResourceLoaderInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class AccountResourceLoader implements ResourceLoaderInterface { public const RESOURCE_LOADER_KEY = 'account'; diff --git a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/ResourceLoader/ContactResourceLoader.php b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/ResourceLoader/ContactResourceLoader.php index b92024c6949..4c5d8f7bc6c 100644 --- a/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/ResourceLoader/ContactResourceLoader.php +++ b/src/Sulu/Bundle/ContactBundle/Infrastructure/Sulu/Content/ResourceLoader/ContactResourceLoader.php @@ -19,6 +19,11 @@ use Sulu\Bundle\ContactBundle\Entity\ContactInterface; use Sulu\Bundle\ContentBundle\Content\Application\ResourceLoader\ResourceLoaderInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class ContactResourceLoader implements ResourceLoaderInterface { public const RESOURCE_LOADER_KEY = 'contact'; diff --git a/src/Sulu/Bundle/MediaBundle/Infrastructure/Sulu/Content/PropertyResolver/Resolver/MediaSelectionPropertyResolver.php b/src/Sulu/Bundle/MediaBundle/Infrastructure/Sulu/Content/PropertyResolver/Resolver/MediaSelectionPropertyResolver.php index 104ebf6c26a..5f410c789ae 100644 --- a/src/Sulu/Bundle/MediaBundle/Infrastructure/Sulu/Content/PropertyResolver/Resolver/MediaSelectionPropertyResolver.php +++ b/src/Sulu/Bundle/MediaBundle/Infrastructure/Sulu/Content/PropertyResolver/Resolver/MediaSelectionPropertyResolver.php @@ -17,6 +17,11 @@ use Sulu\Bundle\ContentBundle\Content\Application\PropertyResolver\PropertyResolverInterface; use Sulu\Bundle\MediaBundle\Infrastructure\Sulu\Content\ResourceLoader\MediaResourceLoader; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class MediaSelectionPropertyResolver implements PropertyResolverInterface { public function resolve(mixed $data, string $locale, array $params = []): ContentView diff --git a/src/Sulu/Bundle/MediaBundle/Infrastructure/Sulu/Content/ResourceLoader/MediaResourceLoader.php b/src/Sulu/Bundle/MediaBundle/Infrastructure/Sulu/Content/ResourceLoader/MediaResourceLoader.php index 53b76ef9529..7317ae45c18 100644 --- a/src/Sulu/Bundle/MediaBundle/Infrastructure/Sulu/Content/ResourceLoader/MediaResourceLoader.php +++ b/src/Sulu/Bundle/MediaBundle/Infrastructure/Sulu/Content/ResourceLoader/MediaResourceLoader.php @@ -16,6 +16,11 @@ use Sulu\Bundle\ContentBundle\Content\Application\ResourceLoader\ResourceLoaderInterface; use Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface; +/** + * @internal if you need to override this service, create a new service with based on ResourceLoaderInterface instead of extending this class + * + * @final + */ class MediaResourceLoader implements ResourceLoaderInterface { public const RESOURCE_LOADER_KEY = 'media'; diff --git a/src/Sulu/Bundle/TagBundle/Infrastructure/Sulu/Content/PropertyResolver/TagSelectionPropertyResolver.php b/src/Sulu/Bundle/TagBundle/Infrastructure/Sulu/Content/PropertyResolver/TagSelectionPropertyResolver.php new file mode 100644 index 00000000000..f71d14d78d6 --- /dev/null +++ b/src/Sulu/Bundle/TagBundle/Infrastructure/Sulu/Content/PropertyResolver/TagSelectionPropertyResolver.php @@ -0,0 +1,50 @@ + []]); + } + + /** @var string $resourceLoaderKey */ + $resourceLoaderKey = $params['resourceLoader'] ?? TagResourceLoader::getKey(); + + return ContentView::createResolvables( + $data, + $resourceLoaderKey, + ['ids' => $data], + ); + } + + public static function getType(): string + { + return 'tag_selection'; + } +} diff --git a/src/Sulu/Bundle/TagBundle/Infrastructure/Sulu/Content/ResourceLoader/TagResourceLoader.php b/src/Sulu/Bundle/TagBundle/Infrastructure/Sulu/Content/ResourceLoader/TagResourceLoader.php new file mode 100644 index 00000000000..d2dace6a4ea --- /dev/null +++ b/src/Sulu/Bundle/TagBundle/Infrastructure/Sulu/Content/ResourceLoader/TagResourceLoader.php @@ -0,0 +1,47 @@ +tagRepository->findBy(['id' => $ids]); + + $mappedResult = []; + foreach ($result as $tag) { + $mappedResult[$tag->getId()] = $tag->getName(); + } + + return $mappedResult; + } + + public static function getKey(): string + { + return self::RESOURCE_LOADER_KEY; + } +}