diff --git a/src/Grid/Column/Collector/Asset/MetadataCollector.php b/src/Grid/Column/Collector/Asset/MetadataCollector.php index 6514eb4a..7d8d98b1 100644 --- a/src/Grid/Column/Collector/Asset/MetadataCollector.php +++ b/src/Grid/Column/Collector/Asset/MetadataCollector.php @@ -16,12 +16,12 @@ namespace Pimcore\Bundle\StudioBackendBundle\Grid\Column\Collector\Asset; -use Pimcore\Bundle\StudioBackendBundle\Asset\Service\Data\CustomMetadataServiceInterface; use Pimcore\Bundle\StudioBackendBundle\Grid\Column\ColumnCollectorInterface; use Pimcore\Bundle\StudioBackendBundle\Grid\Column\ColumnDefinitionInterface; use Pimcore\Bundle\StudioBackendBundle\Grid\Column\FrontendType; use Pimcore\Bundle\StudioBackendBundle\Grid\Schema\ColumnConfiguration; use Pimcore\Bundle\StudioBackendBundle\Metadata\Repository\MetadataRepositoryInterface; +use Pimcore\Bundle\StudioBackendBundle\Metadata\Service\MetadataServiceInterface; use Pimcore\Bundle\StudioBackendBundle\Util\Constant\ElementTypes; use function array_key_exists; @@ -59,7 +59,7 @@ public function getColumnConfigurations(array $availableColumnDefinitions): arra */ private function getDefaultMetadata(): array { - $defaultMetadata = CustomMetadataServiceInterface::DEFAULT_METADATA; + $defaultMetadata = MetadataServiceInterface::DEFAULT_METADATA; $columns = []; foreach ($defaultMetadata as $metadata) { $columns[] = new ColumnConfiguration( diff --git a/src/Asset/Controller/Data/CustomMetadataController.php b/src/Metadata/Controller/Asset/CustomMetadataController.php similarity index 96% rename from src/Asset/Controller/Data/CustomMetadataController.php rename to src/Metadata/Controller/Asset/CustomMetadataController.php index 0a9751fb..f4fca2eb 100644 --- a/src/Asset/Controller/Data/CustomMetadataController.php +++ b/src/Metadata/Controller/Asset/CustomMetadataController.php @@ -17,9 +17,9 @@ namespace Pimcore\Bundle\StudioBackendBundle\Asset\Controller\Data; use OpenApi\Attributes\Get; -use Pimcore\Bundle\StudioBackendBundle\Asset\Schema\CustomMetadata; use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController; use Pimcore\Bundle\StudioBackendBundle\Exception\Api\AccessDeniedException; +use Pimcore\Bundle\StudioBackendBundle\Metadata\Schema\CustomMetadata; use Pimcore\Bundle\StudioBackendBundle\Metadata\Service\MetadataServiceInterface; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Content\ItemsJson; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Parameter\Path\IdParameter; @@ -59,7 +59,7 @@ public function __construct( operationId: 'asset_custom_metadata_get_by_id', description: 'asset_custom_metadata_get_by_id_description', summary: 'asset_custom_metadata_get_by_id_summary', - tags: [Tags::Assets->name] + tags: [Tags::Metadata->name] )] #[IdParameter(type: ElementTypes::TYPE_ASSET)] #[SuccessResponse( diff --git a/src/Metadata/Service/MetadataService.php b/src/Metadata/Service/MetadataService.php index 96daa03c..421b84db 100644 --- a/src/Metadata/Service/MetadataService.php +++ b/src/Metadata/Service/MetadataService.php @@ -17,9 +17,8 @@ namespace Pimcore\Bundle\StudioBackendBundle\Metadata\Service; use Pimcore\Bundle\StaticResolverBundle\Models\Element\ServiceResolverInterface; -use Pimcore\Bundle\StudioBackendBundle\Asset\Event\PreResponse\CustomMetadataEvent; -use Pimcore\Bundle\StudioBackendBundle\Asset\Schema\CustomMetadata; use Pimcore\Bundle\StudioBackendBundle\Exception\Api\AccessDeniedException; +use Pimcore\Bundle\StudioBackendBundle\Metadata\Event\PreResponse\CustomMetadataEvent; use Pimcore\Bundle\StudioBackendBundle\Metadata\Event\PreResponse\PredefinedMetadataEvent; use Pimcore\Bundle\StudioBackendBundle\Metadata\Hydrator\MetadataHydratorInterface; use Pimcore\Bundle\StudioBackendBundle\Metadata\MappedParameter\MetadataParameters; @@ -40,10 +39,10 @@ public function __construct( private MetadataRepositoryInterface $metadataRepository, - private MetadataHydratorInterface $hydrator, private SecurityServiceInterface $securityService, private ServiceResolverInterface $serviceResolver, - private EventDispatcherInterface $eventDispatcher + private EventDispatcherInterface $eventDispatcher, + private MetadataHydratorInterface $hydrator ) { } diff --git a/src/Metadata/Service/MetadataServiceInterface.php b/src/Metadata/Service/MetadataServiceInterface.php index 132af273..3d56a630 100644 --- a/src/Metadata/Service/MetadataServiceInterface.php +++ b/src/Metadata/Service/MetadataServiceInterface.php @@ -16,9 +16,10 @@ namespace Pimcore\Bundle\StudioBackendBundle\Metadata\Service; -use Pimcore\Bundle\StudioBackendBundle\Asset\Schema\CustomMetadata; use Pimcore\Bundle\StudioBackendBundle\Exception\Api\AccessDeniedException; use Pimcore\Bundle\StudioBackendBundle\Metadata\MappedParameter\MetadataParameters; +use Pimcore\Bundle\StudioBackendBundle\Metadata\Schema\CustomMetadata; +use Pimcore\Bundle\StudioBackendBundle\Metadata\Schema\PredefinedMetadata; /** * @internal @@ -31,9 +32,11 @@ interface MetadataServiceInterface * @return array * * @throws AccessDeniedException - * */ public function getCustomMetadata(int $id): array; + /** + * @return array + */ public function getPredefinedMetadata(MetadataParameters $parameters): array; }