Skip to content

Commit

Permalink
List only version 0 of every content
Browse files Browse the repository at this point in the history
  • Loading branch information
redjanym committed May 16, 2024
1 parent 834f29e commit ef04a0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public function cgetAction(Request $request): Response
$fieldDescriptors = $this->fieldDescriptorFactory->getFieldDescriptors(Example::RESOURCE_KEY);
/** @var DoctrineListBuilder $listBuilder */
$listBuilder = $this->listBuilderFactory->create(Example::class);
$listBuilder->where($fieldDescriptors['version'], (string) DimensionContentInterface::DEFAULT_VERSION);
$listBuilder->addSelectField($fieldDescriptors['locale']);
$listBuilder->addSelectField($fieldDescriptors['ghostLocale']);
$listBuilder->addSelectField($fieldDescriptors['version']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<entity-name>dimensionContent</entity-name>
<field-name>Sulu\Bundle\ContentBundle\Tests\Application\ExampleTestBundle\Entity\Example.dimensionContents</field-name>
<method>LEFT</method>
<condition>dimensionContent.locale = :locale AND dimensionContent.stage = 'draft'</condition>
<condition>dimensionContent.locale = :locale AND dimensionContent.stage = 'draft' AND dimensionContent.version = '0'</condition>
</join>
</joins>

Expand All @@ -16,7 +16,7 @@
<entity-name>unlocalizedDimensionContent</entity-name>
<field-name>Sulu\Bundle\ContentBundle\Tests\Application\ExampleTestBundle\Entity\Example.dimensionContents</field-name>
<method>LEFT</method>
<condition>unlocalizedDimensionContent.locale IS NULL AND unlocalizedDimensionContent.stage = 'draft'</condition>
<condition>unlocalizedDimensionContent.locale IS NULL AND unlocalizedDimensionContent.stage = 'draft' AND unlocalizedDimensionContent.version = '0'</condition>
</join>
</joins>

Expand All @@ -25,7 +25,7 @@
<entity-name>ghostDimensionContent</entity-name>
<field-name>Sulu\Bundle\ContentBundle\Tests\Application\ExampleTestBundle\Entity\Example.dimensionContents</field-name>
<method>LEFT</method>
<condition>dimensionContent.locale IS NULL AND ghostDimensionContent.locale = unlocalizedDimensionContent.ghostLocale AND ghostDimensionContent.stage = 'draft'</condition>
<condition>dimensionContent.locale IS NULL AND ghostDimensionContent.locale = unlocalizedDimensionContent.ghostLocale AND ghostDimensionContent.stage = 'draft' AND ghostDimensionContent.version = '0'</condition>
</join>
</joins>

Expand Down

0 comments on commit ef04a0a

Please sign in to comment.