Skip to content

Commit

Permalink
[CatalogPromotion] Create parameters with collections of scopes and a…
Browse files Browse the repository at this point in the history
…ctions types
  • Loading branch information
GSadee committed Dec 16, 2021
1 parent 551d34d commit 7f33db6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
-->

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="sylius.catalog_promotion.scopes" type="collection">
<parameter type="constant">Sylius\Component\Core\Model\CatalogPromotionScopeInterface::TYPE_FOR_PRODUCTS</parameter>
<parameter type="constant">Sylius\Component\Core\Model\CatalogPromotionScopeInterface::TYPE_FOR_TAXONS</parameter>
<parameter type="constant">Sylius\Component\Core\Model\CatalogPromotionScopeInterface::TYPE_FOR_VARIANTS</parameter>
</parameter>
</parameters>

<services>
<defaults public="true" />

Expand Down Expand Up @@ -65,11 +73,7 @@
</service>

<service id="Sylius\Bundle\CoreBundle\Validator\Constraints\CatalogPromotionScopeValidator">
<argument type="collection">
<argument type="constant">Sylius\Component\Core\Model\CatalogPromotionScopeInterface::TYPE_FOR_PRODUCTS</argument>
<argument type="constant">Sylius\Component\Core\Model\CatalogPromotionScopeInterface::TYPE_FOR_TAXONS</argument>
<argument type="constant">Sylius\Component\Core\Model\CatalogPromotionScopeInterface::TYPE_FOR_VARIANTS</argument>
</argument>
<argument>%sylius.catalog_promotion.scopes%</argument>
<argument type="tagged_iterator" tag="sylius.catalog_promotion.scope_validator" index-by="key" />
<tag name="validator.constraint_validator" alias="sylius_catalog_promotion_scope" />
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
-->

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="sylius.catalog_promotion.actions" type="collection">
<parameter type="constant">Sylius\Component\Promotion\Model\CatalogPromotionActionInterface::TYPE_FIXED_DISCOUNT</parameter>
<parameter type="constant">Sylius\Component\Promotion\Model\CatalogPromotionActionInterface::TYPE_PERCENTAGE_DISCOUNT</parameter>
</parameter>
</parameters>

<services>
<defaults public="true" />

Expand All @@ -34,10 +41,7 @@
</service>

<service id="Sylius\Bundle\PromotionBundle\Validator\CatalogPromotionActionValidator">
<argument type="collection">
<argument type="constant">Sylius\Component\Promotion\Model\CatalogPromotionActionInterface::TYPE_FIXED_DISCOUNT</argument>
<argument type="constant">Sylius\Component\Promotion\Model\CatalogPromotionActionInterface::TYPE_PERCENTAGE_DISCOUNT</argument>
</argument>
<argument>%sylius.catalog_promotion.actions%</argument>
<argument type="tagged_iterator" tag="sylius.catalog_promotion.action_validator" index-by="key" />
<tag name="validator.constraint_validator" alias="sylius_catalog_promotion_action" />
</service>
Expand Down

0 comments on commit 7f33db6

Please sign in to comment.