Skip to content

Commit b68d3e1

Browse files
committed
Merge remote-tracking branch 'origin/2025.4' into 2026.x
2 parents 8cc2cbe + 7589e68 commit b68d3e1

15 files changed

Lines changed: 56 additions & 18 deletions

src/ClassificationStore/Controller/GetLayoutByKeyController.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ public function __construct(
5555
* @throws NotFoundException
5656
*/
5757
#[Route(
58-
path: '/classification-store/layout-by-key/{keyId}',
58+
path: '/classification-store/layout-by-key/{keyId}/{groupId}',
5959
name: 'pimcore_studio_api_classification_store_get_layout_by_key',
6060
methods: ['GET']
6161
)]
6262
#[IsGranted(UserPermissions::DATA_OBJECTS->value)]
6363
#[Get(
64-
path: self::PREFIX . '/classification-store/layout-by-key/{keyId}',
64+
path: self::PREFIX . '/classification-store/layout-by-key/{keyId}/{groupId}',
6565
operationId: 'classification_store_get_layout_by_key',
6666
description: 'classification_store_get_layout_by_key_description',
6767
summary: 'classification_store_get_layout_by_key_summary',
@@ -80,6 +80,10 @@ public function __construct(
8080
type: 'Key ID',
8181
name: 'keyId',
8282
)]
83+
#[PathIdParameter(
84+
type: 'Group ID',
85+
name: 'groupId',
86+
)]
8387
#[TextFieldParameter(
8488
name: 'fieldName',
8589
description: 'Field Name',
@@ -94,9 +98,10 @@ public function __construct(
9498
public function getLayoutByKey(
9599
#[MapQueryString] LayoutParameter $layoutParameter,
96100
int $keyId,
101+
int $groupId
97102
): JsonResponse {
98103
return $this->jsonResponse(
99-
$this->keyGroupLayoutService->getKeyLayout($layoutParameter, $keyId)
104+
$this->keyGroupLayoutService->getKeyLayout($layoutParameter, $keyId, $groupId)
100105
);
101106
}
102107
}

src/ClassificationStore/Repository/KeyGroupRelationRepository.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ public function getByGroupId(int $groupId): array
6868
/**
6969
* @inheritDoc
7070
*/
71-
public function getByKeyId(int $keyId): KeyGroupRelation
71+
public function getByKeyGroupId(int $keyId, int $groupId): KeyGroupRelation
7272
{
7373
$listing = new Listing();
7474
$listing->setOrder('ASC');
75-
$listing->setCondition('id = ?', $keyId);
75+
$listing->addConditionParam('keyId = ?', $keyId);
76+
$listing->addConditionParam('groupId = ?', $groupId);
7677

7778
$list = $listing->load();
7879

src/ClassificationStore/Repository/KeyGroupRelationRepositoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ public function getByGroupId(int $groupId): array;
4242
/**
4343
* @throws NotFoundException
4444
*/
45-
public function getByKeyId(int $keyId): KeyGroupRelation;
45+
public function getByKeyGroupId(int $keyId, int $groupId): KeyGroupRelation;
4646
}

src/ClassificationStore/Service/KeyGroupLayoutService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public function getLayoutDefinition(
7676
*/
7777
public function getKeyLayout(
7878
LayoutParameter $layoutParameter,
79-
int $keyId
79+
int $keyId,
80+
int $groupId
8081
): KeyLayout {
8182

8283
$object = null;
@@ -88,7 +89,7 @@ public function getKeyLayout(
8889
}
8990
}
9091

91-
$key = $this->keyGroupRelationRepository->getByKeyId($keyId);
92+
$key = $this->keyGroupRelationRepository->getByKeyGroupId($keyId, $groupId);
9293
$definition = $this->getLayoutDefinition($key, $layoutParameter->getFieldName(), $object);
9394

9495
return new KeyLayout(

src/ClassificationStore/Service/KeyGroupLayoutServiceInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ public function getLayoutDefinition(
3838
public function getKeyLayout(
3939
LayoutParameter $layoutParameter,
4040
int $keyId,
41+
int $groupId
4142
): KeyLayout;
4243
}

src/DataIndex/Filter/DataObject/Classificationstore/BooleanFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ public function apply(mixed $parameters, QueryInterface $query): QueryInterface
5353

5454
$filterValue = $this->getClassificationStoreFilterValue($column->getFilterValue());
5555

56-
$key = $this->keyGroupRelationRepository->getByKeyId($filterValue->getKeyId());
56+
$key = $this->keyGroupRelationRepository->getByKeyGroupId(
57+
$filterValue->getKeyId(),
58+
$filterValue->getGroupId()
59+
);
5760
$group = $this->groupConfigRepository->getById($filterValue->getGroupId());
5861

5962
if (!is_array($filterValue->getValue())) {

src/DataIndex/Filter/DataObject/Classificationstore/DateFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ public function apply(mixed $parameters, QueryInterface $query): QueryInterface
5050

5151
foreach ($parameters->getColumnFilterByType(ColumnType::CLASSIFICATION_STORE_DATE->value) as $column) {
5252
$filterValue = $this->getClassificationStoreFilterValue($column->getFilterValue());
53-
$key = $this->keyGroupRelationRepository->getByKeyId($filterValue->getKeyId());
53+
$key = $this->keyGroupRelationRepository->getByKeyGroupId(
54+
$filterValue->getKeyId(),
55+
$filterValue->getGroupId()
56+
);
5457
$group = $this->groupConfigRepository->getById($filterValue->getGroupId());
5558
/** @var DataObjectQueryInterface $query */
5659
$query = $this->applyClassificationStoreDateFilter($column, $query, $key, $group, $filterValue, true);

src/DataIndex/Filter/DataObject/Classificationstore/DateTimeFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ public function apply(mixed $parameters, QueryInterface $query): QueryInterface
5050

5151
foreach ($parameters->getColumnFilterByType(ColumnType::CLASSIFICATION_STORE_DATETIME->value) as $column) {
5252
$filterValue = $this->getClassificationStoreFilterValue($column->getFilterValue());
53-
$key = $this->keyGroupRelationRepository->getByKeyId($filterValue->getKeyId());
53+
$key = $this->keyGroupRelationRepository->getByKeyGroupId(
54+
$filterValue->getKeyId(),
55+
$filterValue->getGroupId()
56+
);
5457
$group = $this->groupConfigRepository->getById($filterValue->getGroupId());
5558
/** @var DataObjectQueryInterface $query */
5659
$query = $this->applyClassificationStoreDateFilter($column, $query, $key, $group, $filterValue, false);

src/DataIndex/Filter/DataObject/Classificationstore/InputQuantityValueFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public function apply(mixed $parameters, QueryInterface $query): QueryInterface
5454

5555
$filterValue = $this->getClassificationStoreFilterValue($column->getFilterValue());
5656

57-
$key = $this->keyGroupRelationRepository->getByKeyId($filterValue->getKeyId());
57+
$key = $this->keyGroupRelationRepository->getByKeyGroupId(
58+
$filterValue->getKeyId(),
59+
$filterValue->getGroupId()
60+
);
5861
$group = $this->groupConfigRepository->getById($filterValue->getGroupId());
5962
$value = $filterValue->getValue();
6063

src/DataIndex/Filter/DataObject/Classificationstore/NumberFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ public function apply(mixed $parameters, QueryInterface $query): QueryInterface
6666
$this->addFilterToQuery(
6767
$query,
6868
$column,
69-
$this->keyGroupRelationRepository->getByKeyId($filterValue->getKeyId()),
69+
$this->keyGroupRelationRepository->getByKeyGroupId(
70+
$filterValue->getKeyId(),
71+
$filterValue->getGroupId()
72+
),
7073
$this->groupConfigRepository->getById($filterValue->getGroupId()),
7174
$mode,
7275
$isValue,

0 commit comments

Comments
 (0)