Skip to content

Commit

Permalink
Move Controller
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Nov 29, 2024
1 parent fd44640 commit 638ab96
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Grid/Column/Collector/Asset/MetadataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down
7 changes: 3 additions & 4 deletions src/Metadata/Service/MetadataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
) {
}

Expand Down
7 changes: 5 additions & 2 deletions src/Metadata/Service/MetadataServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,9 +32,11 @@ interface MetadataServiceInterface
* @return array<int, CustomMetadata>
*
* @throws AccessDeniedException
*
*/
public function getCustomMetadata(int $id): array;

/**
* @return array<int, PredefinedMetadata>
*/
public function getPredefinedMetadata(MetadataParameters $parameters): array;
}

0 comments on commit 638ab96

Please sign in to comment.