Skip to content

Commit

Permalink
move ProductType related extensions definitions to dedicated file
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMilek authored and GSadee committed May 8, 2024
1 parent 115d4c2 commit 10a2cc5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace Sylius\Bundle\AdminBundle\Form\Extension;

use Sylius\Bundle\CoreBundle\Form\Type\Product\ProductImageType;
use Sylius\Bundle\ProductBundle\Form\Type\ProductAssociationsType;
use Sylius\Bundle\ProductBundle\Form\Type\ProductType;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormBuilderInterface;
Expand All @@ -28,9 +27,6 @@ final class ProductTypeExtension extends AbstractTypeExtension
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('associations', ProductAssociationsType::class, [
'label' => false,
])
->add('images', LiveCollectionType::class, [
'entry_type' => ProductImageType::class,
'entry_options' => ['product' => $options['data']],
Expand Down
13 changes: 0 additions & 13 deletions src/Sylius/Bundle/AdminBundle/Resources/config/services/form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@
<tag name="form.type_extension" />
</service>

<service id="sylius_admin.form.extension.type.product" class="Sylius\Bundle\AdminBundle\Form\Extension\ProductTypeExtension">
<tag name="form.type_extension" />
</service>

<service id="sylius_admin.form.extension.type.product_associations" class="Sylius\Bundle\AdminBundle\Form\Extension\ProductAssociationsTypeExtension">
<tag name="form.type_extension" />
</service>

<service id="sylius.form.extension.type.product_image" class="Sylius\Bundle\AdminBundle\Form\Extension\ProductImageTypeExtension">
<argument>%sylius.model.product_variant.class%</argument>
<tag name="form.type_extension" />
</service>

<service id="sylius_admin.form.extension.type.channel" class="Sylius\Bundle\AdminBundle\Form\Extension\ChannelTypeExtension">
<tag name="form.type_extension" extended-type="Sylius\Bundle\ChannelBundle\Form\Type\ChannelType" priority="50" />
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,14 @@
<service id="sylius_admin.form.extension.product" class="Sylius\Bundle\AdminBundle\Form\Extension\ProductTypeExtension">
<tag name="form.type_extension" />
</service>

<service id="sylius_admin.form.extension.type.product_associations" class="Sylius\Bundle\AdminBundle\Form\Extension\ProductAssociationsTypeExtension">
<tag name="form.type_extension" />
</service>

<service id="sylius.form.extension.type.product_image" class="Sylius\Bundle\AdminBundle\Form\Extension\ProductImageTypeExtension">
<argument>%sylius.model.product_variant.class%</argument>
<tag name="form.type_extension" />
</service>
</services>
</container>

0 comments on commit 10a2cc5

Please sign in to comment.