diff --git a/docs/book/products.rst b/docs/book/products.rst index c40da6a51a..7cb79c4412 100644 --- a/docs/book/products.rst +++ b/docs/book/products.rst @@ -160,5 +160,3 @@ Learn more: * :doc:`Product - Bundle Documentation ` * :doc:`Product - Component Documentation ` -* :doc:`Variation- Bundle Documentation ` -* :doc:`Variation - Component Documentation ` diff --git a/docs/bundles/SyliusProductBundle/index.rst b/docs/bundles/SyliusProductBundle/index.rst index 4fb0035c26..555ff132f4 100644 --- a/docs/bundles/SyliusProductBundle/index.rst +++ b/docs/bundles/SyliusProductBundle/index.rst @@ -4,10 +4,6 @@ SyliusProductBundle The Sylius product catalog is made available as set of 2 standalone bundles. This component contains the most basic product model with properties (attributes) support. It also includes the product prototyping system, which serves as a template for creating similar products. -If you need product options support, please see :doc:`SyliusVariationBundle ` which allows to manage -product variations with a very flexible architecture. - - .. toctree:: :maxdepth: 1 :numbered: diff --git a/docs/bundles/SyliusProductBundle/installation.rst b/docs/bundles/SyliusProductBundle/installation.rst index c6338b4cb5..9aeb697c1f 100644 --- a/docs/bundles/SyliusProductBundle/installation.rst +++ b/docs/bundles/SyliusProductBundle/installation.rst @@ -41,7 +41,6 @@ Don't worry, everything was automatically installed via Composer. new Sylius\Bundle\ProductBundle\SyliusProductBundle(), new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(), new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(), - new Sylius\Bundle\VariationBundle\SyliusVariationBundle(), // Other bundles... new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), diff --git a/phpspec.yml.dist b/phpspec.yml.dist index 169e01d837..c6ab61c8c8 100644 --- a/phpspec.yml.dist +++ b/phpspec.yml.dist @@ -63,7 +63,6 @@ suites: ThemeBundle: { namespace: Sylius\Bundle\ThemeBundle, psr4_prefix: Sylius\Bundle\ThemeBundle , spec_path: src/Sylius/Bundle/ThemeBundle, src_path: src/Sylius/Bundle/ThemeBundle } UiBundle: { namespace: Sylius\Bundle\UiBundle, psr4_prefix: Sylius\Bundle\UiBundle, spec_path: src/Sylius/Bundle/UiBundle, src_path: src/Sylius/Bundle/UiBundle } UserBundle: { namespace: Sylius\Bundle\UserBundle, psr4_prefix: Sylius\Bundle\UserBundle, spec_path: src/Sylius/Bundle/UserBundle, src_path: src/Sylius/Bundle/UserBundle } - VariationBundle: { namespace: Sylius\Bundle\VariationBundle, psr4_prefix: Sylius\Bundle\VariationBundle, spec_path: src/Sylius/Bundle/VariationBundle, src_path: src/Sylius/Bundle/VariationBundle } Behat: { namespace: Sylius\Behat, psr4_prefix: Sylius\Behat, spec_path: src/Sylius/Behat, src_path: src/Sylius/Behat } diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php index ff232ad596..0c5f15d4c5 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php +++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php @@ -41,7 +41,6 @@ class Kernel extends HttpKernel new \Sylius\Bundle\LocaleBundle\SyliusLocaleBundle(), new \Sylius\Bundle\ProductBundle\SyliusProductBundle(), new \Sylius\Bundle\ChannelBundle\SyliusChannelBundle(), - new \Sylius\Bundle\VariationBundle\SyliusVariationBundle(), new \Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(), new \Sylius\Bundle\TaxationBundle\SyliusTaxationBundle(), new \Sylius\Bundle\ShippingBundle\SyliusShippingBundle(), diff --git a/src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml b/src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml index d34e439b6f..4f05f95a33 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml +++ b/src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml @@ -18,7 +18,6 @@ imports: - { resource: "@SyliusTaxationBundle/Resources/config/app/config.yml" } - { resource: "@SyliusTaxonomyBundle/Resources/config/app/config.yml" } - { resource: "@SyliusUserBundle/Resources/config/app/config.yml" } - - { resource: "@SyliusVariationBundle/Resources/config/app/config.yml" } - { resource: "parameters.yml" } - { resource: "sylius.yml" } diff --git a/src/Sylius/Bundle/CoreBundle/Resources/config/app/sylius.yml b/src/Sylius/Bundle/CoreBundle/Resources/config/app/sylius.yml index a93db34ede..462b8f708f 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/config/app/sylius.yml +++ b/src/Sylius/Bundle/CoreBundle/Resources/config/app/sylius.yml @@ -142,6 +142,13 @@ sylius_product: model: Sylius\Component\Core\Model\ProductTranslation form: default: Sylius\Bundle\CoreBundle\Form\Type\ProductTranslationType + product_variant: + classes: + model: Sylius\Component\Core\Model\ProductVariant + interface: Sylius\Component\Core\Model\ProductVariantInterface + repository: Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductVariantRepository + form: + default: Sylius\Bundle\CoreBundle\Form\Type\ProductVariantType sylius_promotion: resources: @@ -249,13 +256,3 @@ sylius_customer: repository: Sylius\Bundle\CoreBundle\Doctrine\ORM\CustomerRepository form: default: Sylius\Bundle\CoreBundle\Form\Type\CustomerType - -sylius_variation: - resources: - product: - variant: - classes: - model: Sylius\Component\Core\Model\ProductVariant - repository: Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductVariantRepository - form: - default: Sylius\Bundle\CoreBundle\Form\Type\ProductVariantType diff --git a/src/Sylius/Bundle/CoreBundle/spec/Form/Type/ProductVariantTypeSpec.php b/src/Sylius/Bundle/CoreBundle/spec/Form/Type/ProductVariantTypeSpec.php index dbbc88c89c..01dab37335 100644 --- a/src/Sylius/Bundle/CoreBundle/spec/Form/Type/ProductVariantTypeSpec.php +++ b/src/Sylius/Bundle/CoreBundle/spec/Form/Type/ProductVariantTypeSpec.php @@ -12,7 +12,7 @@ namespace spec\Sylius\Bundle\CoreBundle\Form\Type; use PhpSpec\ObjectBehavior; -use Sylius\Bundle\VariationBundle\Form\Type\VariantType; +use Sylius\Bundle\ProductBundle\Form\Type\VariantType; use Symfony\Component\Form\FormTypeInterface; final class ProductVariantTypeSpec extends ObjectBehavior diff --git a/src/Sylius/Bundle/ProductBundle/DependencyInjection/Configuration.php b/src/Sylius/Bundle/ProductBundle/DependencyInjection/Configuration.php index 278d5be296..50e31a91e2 100644 --- a/src/Sylius/Bundle/ProductBundle/DependencyInjection/Configuration.php +++ b/src/Sylius/Bundle/ProductBundle/DependencyInjection/Configuration.php @@ -15,15 +15,32 @@ use Sylius\Bundle\CoreBundle\Form\Type\LegacyProductType; use Sylius\Bundle\ProductBundle\Form\Type\ProductTranslationType; use Sylius\Bundle\ProductBundle\Form\Type\ProductType; use Sylius\Bundle\ProductBundle\Form\Type\ProductVariantGenerationType; +use Sylius\Bundle\ProductBundle\Form\Type\VariantType; use Sylius\Bundle\ResourceBundle\Controller\ResourceController; use Sylius\Bundle\ResourceBundle\Form\Type\ResourceChoiceType; +use Sylius\Bundle\ResourceBundle\Form\Type\ResourceFromIdentifierType; use Sylius\Bundle\ResourceBundle\SyliusResourceBundle; +use Sylius\Bundle\ProductBundle\Form\Type\OptionTranslationType; +use Sylius\Bundle\ProductBundle\Form\Type\OptionType; +use Sylius\Bundle\ProductBundle\Form\Type\OptionValueTranslationType; +use Sylius\Bundle\ProductBundle\Form\Type\OptionValueType; use Sylius\Component\Product\Factory\ProductFactory; +use Sylius\Component\Product\Model\Option; +use Sylius\Component\Product\Model\OptionInterface; +use Sylius\Component\Product\Model\OptionTranslation; +use Sylius\Component\Product\Model\OptionTranslationInterface; +use Sylius\Component\Product\Model\OptionValue; +use Sylius\Component\Product\Model\OptionValueInterface; +use Sylius\Component\Product\Model\OptionValueTranslation; +use Sylius\Component\Product\Model\OptionValueTranslationInterface; use Sylius\Component\Product\Model\Product; use Sylius\Component\Product\Model\ProductInterface; use Sylius\Component\Product\Model\ProductTranslation; use Sylius\Component\Product\Model\ProductTranslationInterface; +use Sylius\Component\Product\Model\Variant; +use Sylius\Component\Product\Model\VariantInterface; use Sylius\Component\Resource\Factory\Factory; +use Sylius\Component\Resource\Factory\TranslatableFactory; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -135,6 +152,171 @@ class Configuration implements ConfigurationInterface ->end() ->end() ->end() + ->arrayNode('product_variant') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(Variant::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(VariantInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(Factory::class)->end() + ->arrayNode('form') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('default')->defaultValue(VariantType::class)->cannotBeEmpty()->end() + ->scalarNode('from_identifier')->defaultValue(ResourceFromIdentifierType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('validation_groups') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('default') + ->prototype('scalar')->end() + ->defaultValue(['sylius']) + ->cannotBeEmpty() + ->end() + ->arrayNode('from_identifier') + ->prototype('scalar')->end() + ->defaultValue(['sylius']) + ->cannotBeEmpty() + ->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('product_option') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(Option::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(OptionInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(TranslatableFactory::class)->end() + ->arrayNode('form') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('default')->defaultValue(OptionType::class)->cannotBeEmpty()->end() + ->scalarNode('choice')->defaultValue(ResourceChoiceType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('validation_groups') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('default') + ->prototype('scalar')->end() + ->defaultValue(['sylius']) + ->cannotBeEmpty() + ->end() + ->end() + ->end() + ->arrayNode('translation') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(OptionTranslation::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(OptionTranslationInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(Factory::class)->end() + ->arrayNode('form') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('default')->defaultValue(OptionTranslationType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('validation_groups') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('default') + ->prototype('scalar')->end() + ->defaultValue(['sylius']) + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('product_option_value') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('options')->end() + ->arrayNode('classes') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(OptionValue::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(OptionValueInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->cannotBeEmpty()->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(TranslatableFactory::class)->cannotBeEmpty()->end() + ->arrayNode('form') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('default')->defaultValue(OptionValueType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('validation_groups') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('default') + ->prototype('scalar')->end() + ->defaultValue(['sylius']) + ->end() + ->end() + ->end() + ->arrayNode('translation') + ->addDefaultsIfNotSet() + ->children() + ->variableNode('option_value')->end() + ->arrayNode('classes') + ->isRequired() + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('model')->defaultValue(OptionValueTranslation::class)->cannotBeEmpty()->end() + ->scalarNode('interface')->defaultValue(OptionValueTranslationInterface::class)->cannotBeEmpty()->end() + ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() + ->scalarNode('repository')->cannotBeEmpty()->end() + ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end() + ->arrayNode('form') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('default')->defaultValue(OptionValueTranslationType::class)->cannotBeEmpty()->end() + ->end() + ->end() + ->end() + ->end() + ->arrayNode('validation_groups') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('default') + ->prototype('scalar')->end() + ->defaultValue(['sylius']) + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() + ->end() ->end() ->end() ->end() diff --git a/src/Sylius/Bundle/VariationBundle/Doctrine/ORM/OptionRepository.php b/src/Sylius/Bundle/ProductBundle/Doctrine/ORM/OptionRepository.php similarity index 94% rename from src/Sylius/Bundle/VariationBundle/Doctrine/ORM/OptionRepository.php rename to src/Sylius/Bundle/ProductBundle/Doctrine/ORM/OptionRepository.php index 3a979f9f23..08aba43630 100644 --- a/src/Sylius/Bundle/VariationBundle/Doctrine/ORM/OptionRepository.php +++ b/src/Sylius/Bundle/ProductBundle/Doctrine/ORM/OptionRepository.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Doctrine\ORM; +namespace Sylius\Bundle\ProductBundle\Doctrine\ORM; use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Product\Repository\OptionRepositoryInterface; diff --git a/src/Sylius/Bundle/VariationBundle/EventListener/LoadMetadataSubscriber.php b/src/Sylius/Bundle/ProductBundle/EventListener/LoadMetadataSubscriber.php similarity index 98% rename from src/Sylius/Bundle/VariationBundle/EventListener/LoadMetadataSubscriber.php rename to src/Sylius/Bundle/ProductBundle/EventListener/LoadMetadataSubscriber.php index fd34e2f09f..13db11f3bd 100644 --- a/src/Sylius/Bundle/VariationBundle/EventListener/LoadMetadataSubscriber.php +++ b/src/Sylius/Bundle/ProductBundle/EventListener/LoadMetadataSubscriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\EventListener; +namespace Sylius\Bundle\ProductBundle\EventListener; use Doctrine\Common\EventSubscriber; use Doctrine\Common\Persistence\Mapping\ClassMetadata; diff --git a/src/Sylius/Bundle/VariationBundle/Form/DataTransformer/VariantToCombinationTransformer.php b/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/VariantToCombinationTransformer.php similarity index 76% rename from src/Sylius/Bundle/VariationBundle/Form/DataTransformer/VariantToCombinationTransformer.php rename to src/Sylius/Bundle/ProductBundle/Form/DataTransformer/VariantToCombinationTransformer.php index f3ca23c5d2..53d9c9b854 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/DataTransformer/VariantToCombinationTransformer.php +++ b/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/VariantToCombinationTransformer.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\DataTransformer; +namespace Sylius\Bundle\ProductBundle\Form\DataTransformer; use Sylius\Component\Product\Model\OptionValueInterface; use Sylius\Component\Product\Model\ProductInterface; @@ -18,25 +18,21 @@ use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\Exception\UnexpectedTypeException; /** - * Option values combination to variant transformer. - * * @author Paweł Jędrzejewski */ class VariantToCombinationTransformer implements DataTransformerInterface { /** - * Currently matching variable. - * * @var ProductInterface */ - protected $variable; + protected $product; /** - * @param ProductInterface $variable + * @param ProductInterface $product */ - public function __construct(ProductInterface $variable) + public function __construct(ProductInterface $product) { - $this->variable = $variable; + $this->product = $product; } /** @@ -78,16 +74,14 @@ class VariantToCombinationTransformer implements DataTransformerInterface */ private function matches($value) { - foreach ($this->variable->getVariants() as $variant) { + foreach ($this->product->getVariants() as $variant) { foreach ($value as $option) { - if (null === $option || !$variant->hasOption($option)) { - continue 2; + if (null !== $option && $variant->hasOption($option)) { + return $variant; } } - - return $variant; } - return; + return null; } } diff --git a/src/Sylius/Bundle/VariationBundle/Form/EventListener/BuildVariantFormSubscriber.php b/src/Sylius/Bundle/ProductBundle/Form/EventListener/BuildVariantFormSubscriber.php similarity index 77% rename from src/Sylius/Bundle/VariationBundle/Form/EventListener/BuildVariantFormSubscriber.php rename to src/Sylius/Bundle/ProductBundle/Form/EventListener/BuildVariantFormSubscriber.php index 7e47ffc952..c17fa0b6a4 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/EventListener/BuildVariantFormSubscriber.php +++ b/src/Sylius/Bundle/ProductBundle/Form/EventListener/BuildVariantFormSubscriber.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\EventListener; +namespace Sylius\Bundle\ProductBundle\Form\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Form\FormEvent; @@ -23,23 +23,16 @@ use Symfony\Component\Form\FormFactoryInterface; */ class BuildVariantFormSubscriber implements EventSubscriberInterface { - /** - * @var string - */ - protected $variableName; - /** * @var FormFactoryInterface */ private $factory; /** - * @param string $variableName * @param FormFactoryInterface $factory */ - public function __construct($variableName, FormFactoryInterface $factory) + public function __construct(FormFactoryInterface $factory) { - $this->variableName = $variableName; $this->factory = $factory; } @@ -70,7 +63,7 @@ class BuildVariantFormSubscriber implements EventSubscriberInterface // If the object has options, lets add this configuration field. if ($variable->hasOptions()) { - $form->add($this->factory->createNamed('options', sprintf('sylius_%s_option_value_collection', $this->variableName), $variant->getOptions(), [ + $form->add($this->factory->createNamed('options', 'sylius_product_option_value_collection', $variant->getOptions(), [ 'options' => $variable->getOptions(), 'auto_initialize' => false, ])); diff --git a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionTranslationType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionTranslationType.php similarity index 60% rename from src/Sylius/Bundle/VariationBundle/Form/Type/OptionTranslationType.php rename to src/Sylius/Bundle/ProductBundle/Form/Type/OptionTranslationType.php index c4fd4676c1..74d3bd9b5a 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionTranslationType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionTranslationType.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\Type; +namespace Sylius\Bundle\ProductBundle\Form\Type; use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; use Symfony\Component\Form\FormBuilderInterface; @@ -19,23 +19,6 @@ use Symfony\Component\Form\FormBuilderInterface; */ class OptionTranslationType extends AbstractResourceType { - /** - * @var string - */ - protected $variableName; - - /** - * @param string $dataClass - * @param array $validationGroups - * @param string $variableName - */ - public function __construct($dataClass, array $validationGroups, $variableName) - { - parent::__construct($dataClass, $validationGroups); - - $this->variableName = $variableName; - } - /** * {@inheritdoc} */ @@ -53,6 +36,6 @@ class OptionTranslationType extends AbstractResourceType */ public function getName() { - return sprintf('sylius_%s_option_translation', $this->variableName); + return 'sylius_product_option_translation'; } } diff --git a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionType.php similarity index 65% rename from src/Sylius/Bundle/VariationBundle/Form/Type/OptionType.php rename to src/Sylius/Bundle/ProductBundle/Form/Type/OptionType.php index 75fe5cdeb2..a27eb04b94 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionType.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\Type; +namespace Sylius\Bundle\ProductBundle\Form\Type; use Sylius\Bundle\ResourceBundle\Form\EventSubscriber\AddCodeFormSubscriber; use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; @@ -21,23 +21,6 @@ use Symfony\Component\Form\FormBuilderInterface; */ class OptionType extends AbstractResourceType { - /** - * @var string - */ - protected $variableName; - - /** - * @param string $dataClass - * @param array $validationGroups - * @param string $variableName - */ - public function __construct($dataClass, array $validationGroups, $variableName) - { - parent::__construct($dataClass, $validationGroups); - - $this->variableName = $variableName; - } - /** * {@inheritdoc} */ @@ -45,11 +28,11 @@ class OptionType extends AbstractResourceType { $builder ->add('translations', 'sylius_translations', [ - 'type' => sprintf('sylius_%s_option_translation', $this->variableName), + 'type' => 'sylius_product_option_translation', 'label' => 'sylius.form.option.name', ]) ->add('values', 'collection', [ - 'type' => sprintf('sylius_%s_option_value', $this->variableName), + 'type' => 'sylius_product_option_value', 'allow_add' => true, 'allow_delete' => true, 'by_reference' => false, @@ -65,6 +48,6 @@ class OptionType extends AbstractResourceType */ public function getName() { - return sprintf('sylius_%s_option', $this->variableName); + return 'sylius_product_option'; } } diff --git a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueChoiceType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueChoiceType.php similarity index 82% rename from src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueChoiceType.php rename to src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueChoiceType.php index 62a69d8e4f..8f532f579f 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueChoiceType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueChoiceType.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\Type; +namespace Sylius\Bundle\ProductBundle\Form\Type; use Sylius\Component\Product\Model\OptionInterface; use Symfony\Component\Form\AbstractType; @@ -23,19 +23,6 @@ use Symfony\Component\PropertyAccess\PropertyAccess; */ class OptionValueChoiceType extends AbstractType { - /** - * @var string - */ - protected $variableName; - - /** - * @param string $variableName - */ - public function __construct($variableName) - { - $this->variableName = $variableName; - } - /** * {@inheritdoc} */ @@ -79,6 +66,6 @@ class OptionValueChoiceType extends AbstractType */ public function getName() { - return sprintf('sylius_%s_option_value_choice', $this->variableName); + return 'sylius_product_option_value_choice'; } } diff --git a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueCollectionType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueCollectionType.php similarity index 63% rename from src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueCollectionType.php rename to src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueCollectionType.php index 891d96f984..cb5fb65a5c 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueCollectionType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueCollectionType.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\Type; +namespace Sylius\Bundle\ProductBundle\Form\Type; use Sylius\Component\Product\Model\OptionInterface; use Symfony\Component\Form\AbstractType; @@ -27,39 +27,17 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class OptionValueCollectionType extends AbstractType { - /** - * @var string - */ - protected $variableName; - - /** - * @param string $variableName - */ - public function __construct($variableName) - { - $this->variableName = $variableName; - } - /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { - if (!isset($options['options']) || - !is_array($options['options']) && - !($options['options'] instanceof \Traversable && $options['options'] instanceof \ArrayAccess) - ) { - throw new InvalidConfigurationException( - 'array or (\Traversable and \ArrayAccess) of "Sylius\Component\Product\Model\OptionInterface" must be passed to collection' - ); - } - foreach ($options['options'] as $i => $option) { if (!$option instanceof OptionInterface) { throw new InvalidConfigurationException('Each object passed as option list must implement "Sylius\Component\Product\Model\OptionInterface"'); } - $builder->add((string) $option->getId(), sprintf('sylius_%s_option_value_choice', $this->variableName), [ + $builder->add((string) $option->getId(), 'sylius_product_option_value_choice', [ 'label' => $option->getName() ?: $option->getCode(), 'option' => $option, 'property_path' => '['.$i.']', @@ -73,9 +51,8 @@ class OptionValueCollectionType extends AbstractType public function configureOptions(OptionsResolver $resolver) { $resolver - ->setDefaults([ - 'options' => null, - ]) + ->setRequired('options') + ->setAllowedTypes('options', 'array') ; } @@ -84,6 +61,6 @@ class OptionValueCollectionType extends AbstractType */ public function getName() { - return sprintf('sylius_%s_option_value_collection', $this->variableName); + return 'sylius_product_option_value_collection'; } } diff --git a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueTranslationType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueTranslationType.php similarity index 61% rename from src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueTranslationType.php rename to src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueTranslationType.php index a7ee085d7a..6f528c92b3 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueTranslationType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueTranslationType.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\Type; +namespace Sylius\Bundle\ProductBundle\Form\Type; use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; use Symfony\Component\Form\FormBuilderInterface; @@ -19,22 +19,6 @@ use Symfony\Component\Form\FormBuilderInterface; */ class OptionValueTranslationType extends AbstractResourceType { - /** - * @var string - */ - protected $variableName; - - /** - * @param string $dataClass - * @param array $validationGroups - * @param string $variableName - */ - public function __construct($dataClass, array $validationGroups, $variableName) - { - parent::__construct($dataClass, $validationGroups); - $this->variableName = $variableName; - } - /** * {@inheritdoc} */ @@ -52,6 +36,6 @@ class OptionValueTranslationType extends AbstractResourceType */ public function getName() { - return sprintf('sylius_%s_option_value_translation', $this->variableName); + return 'sylius_product_option_value_translation'; } } diff --git a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueType.php similarity index 61% rename from src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueType.php rename to src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueType.php index d1c9a5a7b2..d0f99d92c9 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/Type/OptionValueType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/OptionValueType.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\Type; +namespace Sylius\Bundle\ProductBundle\Form\Type; use Sylius\Bundle\ResourceBundle\Form\EventSubscriber\AddCodeFormSubscriber; use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; @@ -20,23 +20,6 @@ use Symfony\Component\Form\FormBuilderInterface; */ class OptionValueType extends AbstractResourceType { - /** - * @var string - */ - protected $variableName; - - /** - * @param string $dataClass - * @param array $validationGroups - * @param string $variableName - */ - public function __construct($dataClass, array $validationGroups, $variableName) - { - parent::__construct($dataClass, $validationGroups); - - $this->variableName = $variableName; - } - /** * {@inheritdoc} */ @@ -44,7 +27,7 @@ class OptionValueType extends AbstractResourceType { $builder ->add('translations', 'sylius_translations', [ - 'type' => sprintf('sylius_%s_option_value_translation', $this->variableName), + 'type' => 'sylius_product_option_value_translation', 'label' => 'sylius.form.option.name', ]) ->addEventSubscriber(new AddCodeFormSubscriber()) @@ -56,6 +39,6 @@ class OptionValueType extends AbstractResourceType */ public function getName() { - return sprintf('sylius_%s_option_value', $this->variableName); + return 'sylius_product_option_value'; } } diff --git a/src/Sylius/Bundle/VariationBundle/Form/Type/VariantChoiceType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/VariantChoiceType.php similarity index 73% rename from src/Sylius/Bundle/VariationBundle/Form/Type/VariantChoiceType.php rename to src/Sylius/Bundle/ProductBundle/Form/Type/VariantChoiceType.php index 0c549971cd..15fca00121 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/Type/VariantChoiceType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/VariantChoiceType.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\Type; +namespace Sylius\Bundle\ProductBundle\Form\Type; -use Sylius\Bundle\VariationBundle\Form\ChoiceList\VariantChoiceList; use Sylius\Component\Product\Model\ProductInterface; use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -24,19 +24,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class VariantChoiceType extends AbstractType { - /** - * @var string - */ - protected $variableName; - - /** - * @param string $variableName - */ - public function __construct($variableName) - { - $this->variableName = $variableName; - } - /** * {@inheritdoc} */ @@ -53,7 +40,7 @@ class VariantChoiceType extends AbstractType public function configureOptions(OptionsResolver $resolver) { $choiceList = function (Options $options) { - return new VariantChoiceList($options['variable']); + return new ObjectChoiceList($options['product']->getVariants(), 'name', [], null, 'id'); }; $resolver @@ -64,9 +51,9 @@ class VariantChoiceType extends AbstractType 'choice_list' => $choiceList, ]) ->setRequired([ - 'variable', + 'product', ]) - ->setAllowedTypes('variable', ProductInterface::class) + ->setAllowedTypes('product', ProductInterface::class) ; } @@ -83,6 +70,6 @@ class VariantChoiceType extends AbstractType */ public function getName() { - return sprintf('sylius_%s_variant_choice', $this->variableName); + return 'sylius_product_variant_choice'; } } diff --git a/src/Sylius/Bundle/VariationBundle/Form/Type/VariantMatchType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/VariantMatchType.php similarity index 58% rename from src/Sylius/Bundle/VariationBundle/Form/Type/VariantMatchType.php rename to src/Sylius/Bundle/ProductBundle/Form/Type/VariantMatchType.php index b8f8c2c5a6..66ab3b4c28 100644 --- a/src/Sylius/Bundle/VariationBundle/Form/Type/VariantMatchType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/VariantMatchType.php @@ -9,10 +9,10 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Form\Type; +namespace Sylius\Bundle\ProductBundle\Form\Type; use Gedmo\Sluggable\Util\Urlizer; -use Sylius\Bundle\VariationBundle\Form\DataTransformer\VariantToCombinationTransformer; +use Sylius\Bundle\ProductBundle\Form\DataTransformer\VariantToCombinationTransformer; use Sylius\Component\Product\Model\ProductInterface; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; @@ -23,33 +23,20 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class VariantMatchType extends AbstractType { - /** - * @var string - */ - protected $variableName; - - /** - * @param string $variableName - */ - public function __construct($variableName) - { - $this->variableName = $variableName; - } - /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { - foreach ($options['variable']->getOptions() as $i => $option) { - $builder->add($option->getCode(), sprintf('sylius_%s_option_value_choice', $this->variableName), [ + foreach ($options['product']->getOptions() as $i => $option) { + $builder->add($option->getCode(), 'sylius_product_option_value_choice', [ 'label' => $option->getName(), 'option' => $option, 'property_path' => '['.$i.']', ]); } - $builder->addModelTransformer(new VariantToCombinationTransformer($options['variable'])); + $builder->addModelTransformer(new VariantToCombinationTransformer($options['product'])); } /** @@ -58,10 +45,8 @@ class VariantMatchType extends AbstractType public function configureOptions(OptionsResolver $resolver) { $resolver - ->setRequired([ - 'variable', - ]) - ->setAllowedTypes('variable', ProductInterface::class) + ->setRequired('product') + ->setAllowedTypes('product', ProductInterface::class) ; } @@ -70,6 +55,6 @@ class VariantMatchType extends AbstractType */ public function getName() { - return sprintf('sylius_%s_variant_match', $this->variableName); + return 'sylius_product_variant_match'; } } diff --git a/src/Sylius/Bundle/ProductBundle/Form/Type/VariantType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/VariantType.php index 31d56f92d0..8e29da94af 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/Type/VariantType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/VariantType.php @@ -11,24 +11,27 @@ namespace Sylius\Bundle\ProductBundle\Form\Type; -use Sylius\Bundle\VariationBundle\Form\Type\VariantType as BaseVariantType; +use Sylius\Bundle\ResourceBundle\Form\EventSubscriber\AddCodeFormSubscriber; +use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; +use Sylius\Bundle\ProductBundle\Form\EventListener\BuildVariantFormSubscriber; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; /** - * Product variant form type. - * * @author Paweł Jędrzejewski */ -class VariantType extends BaseVariantType +class VariantType extends AbstractResourceType { /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { - parent::buildForm($builder, $options); - $builder + ->add('name', 'text', [ + 'required' => false, + 'label' => 'sylius.form.variant.name', + ]) ->add('availableOn', 'datetime', [ 'required' => false, 'date_widget' => 'single_text', @@ -41,6 +44,17 @@ class VariantType extends BaseVariantType 'time_widget' => 'single_text', 'label' => 'sylius.form.product_variant.available_until', ]) + ->addEventSubscriber(new AddCodeFormSubscriber()) ; + + $builder->addEventSubscriber(new BuildVariantFormSubscriber($builder->getFormFactory())); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'sylius_product_variant'; } } diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/Option.orm.xml b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/Option.orm.xml index 32c0de88f5..fafac2e5ac 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/Option.orm.xml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/Option.orm.xml @@ -11,8 +11,25 @@ --> - + - + + + + + + + + + + + + + diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionTranslation.orm.xml b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionTranslation.orm.xml index 06d6598858..2b9b21352d 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionTranslation.orm.xml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionTranslation.orm.xml @@ -13,6 +13,12 @@ - + + + + + + + diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionValue.orm.xml b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionValue.orm.xml index 9a4202deba..fa035c5218 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionValue.orm.xml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionValue.orm.xml @@ -14,6 +14,11 @@ + + + + + diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionValueTranslation.orm.xml b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionValueTranslation.orm.xml index 19540d1d91..2b790b1052 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionValueTranslation.orm.xml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/OptionValueTranslation.orm.xml @@ -13,6 +13,12 @@ - + + + + + + + diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/Variant.orm.xml b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/Variant.orm.xml index c24a4257ed..eca5ae08a2 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/Variant.orm.xml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/doctrine/model/Variant.orm.xml @@ -14,9 +14,26 @@ + http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd" + xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping" +> + + + + + + + + + + + + + + + diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/driver/doctrine/orm.xml b/src/Sylius/Bundle/ProductBundle/Resources/config/driver/doctrine/orm.xml index 1684a88b88..ea075b42ea 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/driver/doctrine/orm.xml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/driver/doctrine/orm.xml @@ -18,7 +18,7 @@ Sylius\Bundle\AttributeBundle\Doctrine\ORM\AttributeRepository - Sylius\Bundle\VariationBundle\Doctrine\ORM\OptionRepository + Sylius\Bundle\ProductBundle\Doctrine\ORM\OptionRepository diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.Option.yml b/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.Option.yml index 69c2725af4..317c7c75b0 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.Option.yml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.Option.yml @@ -1,3 +1,10 @@ Sylius\Component\Product\Model\Option: exclusion_policy: ALL xml_root_name: option + properties: + code: + exopse: true + type: string + name: + expose: true + type: string diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.OptionValue.yml b/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.OptionValue.yml index fb50168648..6d030c4506 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.OptionValue.yml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.OptionValue.yml @@ -1,3 +1,13 @@ Sylius\Component\Product\Model\OptionValue: exclusion_policy: ALL xml_root_name: option-value + properties: + code: + expose: true + type: string + value: + expose: true + type: string + virtual_properties: + getName: + serialized_name: name diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.Variant.yml b/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.Variant.yml index a8df3777cb..22a80c0ac5 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.Variant.yml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/serializer/Model.Variant.yml @@ -1,3 +1,13 @@ Sylius\Component\Product\Model\Variant: exclusion_policy: ALL xml_root_name: variant + properties: + id: + expose: true + type: integer + xml_attribute: true + presentation: + expose: true + type: string + options: + expose: true diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/services.xml b/src/Sylius/Bundle/ProductBundle/Resources/config/services.xml index 4b02b3a73f..617d11023e 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/services.xml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/services.xml @@ -22,6 +22,15 @@ Sylius\Bundle\ProductBundle\Validator\ProductUniqueValidator Sylius\Bundle\ProductBundle\Form\EventSubscriber\GenerateProductVariantsSubscriber + + Sylius\Bundle\ProductBundle\EventListener\LoadMetadataSubscriber + + Sylius\Bundle\ProductBundle\Validator\VariantUniqueValidator + Sylius\Bundle\ProductBundle\Validator\VariantCombinationValidator + + Sylius\Component\Product\Generator\VariantGenerator + + Sylius\Component\Product\Resolver\DefaultVariantResolver @@ -35,6 +44,28 @@ + + + + %sylius.variation.variables% + + + + + + + + + + + + + + + + + + diff --git a/src/Sylius/Bundle/ProductBundle/Resources/config/validation.xml b/src/Sylius/Bundle/ProductBundle/Resources/config/validation.xml index 2d5ad03c31..4b3be27446 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/config/validation.xml +++ b/src/Sylius/Bundle/ProductBundle/Resources/config/validation.xml @@ -57,4 +57,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Sylius/Bundle/ProductBundle/Resources/translations/messages.en.yml b/src/Sylius/Bundle/ProductBundle/Resources/translations/messages.en.yml index 25dae40b62..892d13e935 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/translations/messages.en.yml +++ b/src/Sylius/Bundle/ProductBundle/Resources/translations/messages.en.yml @@ -16,3 +16,11 @@ sylius: association: type: Association Type product: Associated Product + variant: + name: Name + option: + name: Name + values: Possible values + option_value: + add_value: Add value + value: Value diff --git a/src/Sylius/Bundle/ProductBundle/Resources/translations/validators.en.yml b/src/Sylius/Bundle/ProductBundle/Resources/translations/validators.en.yml index fd9f9e783c..c35fd09c50 100644 --- a/src/Sylius/Bundle/ProductBundle/Resources/translations/validators.en.yml +++ b/src/Sylius/Bundle/ProductBundle/Resources/translations/validators.en.yml @@ -14,3 +14,20 @@ sylius: sku: not_blank: Please enter variant SKU. unique: Variant SKU must be unique. + combination: Variant with this option set already exists. + option: + code: + not_blank: Please enter option code. + unique: The option with given code already exists. + name: + not_blank: Please enter option name. + min_length: Option name must be at least 1 character long.|Option name must be at least {{ limit }} characters long. + max_length: Option name must not be longer than 1 character.|Option name must not be longer than {{ limit }} characters. + values: + min_count: Please add at least {{ limit }} option value.|Please add at least {{ limit }} option values. + option_value: + code: + not_blank: Please enter option value code. + unique: The option value with given code already exists. + value: + not_blank: Please enter option value. diff --git a/src/Sylius/Bundle/VariationBundle/Validator/Constraint/VariantCombination.php b/src/Sylius/Bundle/ProductBundle/Validator/Constraint/VariantCombination.php similarity index 92% rename from src/Sylius/Bundle/VariationBundle/Validator/Constraint/VariantCombination.php rename to src/Sylius/Bundle/ProductBundle/Validator/Constraint/VariantCombination.php index 906a6c3843..faaa2bbb1e 100644 --- a/src/Sylius/Bundle/VariationBundle/Validator/Constraint/VariantCombination.php +++ b/src/Sylius/Bundle/ProductBundle/Validator/Constraint/VariantCombination.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Validator\Constraint; +namespace Sylius\Bundle\ProductBundle\Validator\Constraint; use Symfony\Component\Validator\Constraint; diff --git a/src/Sylius/Bundle/VariationBundle/Validator/Constraint/VariantUnique.php b/src/Sylius/Bundle/ProductBundle/Validator/Constraint/VariantUnique.php similarity index 93% rename from src/Sylius/Bundle/VariationBundle/Validator/Constraint/VariantUnique.php rename to src/Sylius/Bundle/ProductBundle/Validator/Constraint/VariantUnique.php index 1c0a203e4c..4d4786818f 100644 --- a/src/Sylius/Bundle/VariationBundle/Validator/Constraint/VariantUnique.php +++ b/src/Sylius/Bundle/ProductBundle/Validator/Constraint/VariantUnique.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Validator\Constraint; +namespace Sylius\Bundle\ProductBundle\Validator\Constraint; use Symfony\Component\Validator\Constraint; diff --git a/src/Sylius/Bundle/VariationBundle/Validator/VariantCombinationValidator.php b/src/Sylius/Bundle/ProductBundle/Validator/VariantCombinationValidator.php similarity index 97% rename from src/Sylius/Bundle/VariationBundle/Validator/VariantCombinationValidator.php rename to src/Sylius/Bundle/ProductBundle/Validator/VariantCombinationValidator.php index 9f35180e96..5bb7a8ef40 100644 --- a/src/Sylius/Bundle/VariationBundle/Validator/VariantCombinationValidator.php +++ b/src/Sylius/Bundle/ProductBundle/Validator/VariantCombinationValidator.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Validator; +namespace Sylius\Bundle\ProductBundle\Validator; use Sylius\Component\Product\Model\ProductInterface; use Sylius\Component\Product\Model\VariantInterface; diff --git a/src/Sylius/Bundle/VariationBundle/Validator/VariantUniqueValidator.php b/src/Sylius/Bundle/ProductBundle/Validator/VariantUniqueValidator.php similarity index 97% rename from src/Sylius/Bundle/VariationBundle/Validator/VariantUniqueValidator.php rename to src/Sylius/Bundle/ProductBundle/Validator/VariantUniqueValidator.php index d7c5ea0322..bba4e9bdc7 100644 --- a/src/Sylius/Bundle/VariationBundle/Validator/VariantUniqueValidator.php +++ b/src/Sylius/Bundle/ProductBundle/Validator/VariantUniqueValidator.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Sylius\Bundle\VariationBundle\Validator; +namespace Sylius\Bundle\ProductBundle\Validator; use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\Component\Product\Model\VariantInterface; diff --git a/src/Sylius/Bundle/VariationBundle/spec/EventListener/LoadMetadataSubscriberSpec.php b/src/Sylius/Bundle/ProductBundle/spec/EventListener/LoadMetadataSubscriberSpec.php similarity index 97% rename from src/Sylius/Bundle/VariationBundle/spec/EventListener/LoadMetadataSubscriberSpec.php rename to src/Sylius/Bundle/ProductBundle/spec/EventListener/LoadMetadataSubscriberSpec.php index 1599767086..2c94ce0a76 100644 --- a/src/Sylius/Bundle/VariationBundle/spec/EventListener/LoadMetadataSubscriberSpec.php +++ b/src/Sylius/Bundle/ProductBundle/spec/EventListener/LoadMetadataSubscriberSpec.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace spec\Sylius\Bundle\VariationBundle\EventListener; +namespace spec\Sylius\Bundle\ProductBundle\EventListener; use Doctrine\Common\EventSubscriber; use Doctrine\ORM\Event\LoadClassMetadataEventArgs; @@ -48,7 +48,7 @@ final class LoadMetadataSubscriberSpec extends ObjectBehavior function it_is_initializable() { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\EventListener\LoadMetadataSubscriber'); + $this->shouldHaveType('Sylius\Bundle\ProductBundle\EventListener\LoadMetadataSubscriber'); } function it_is_a_Doctrine_event_subscriber() diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/DataTransformer/VariantToCombinationTransformerSpec.php b/src/Sylius/Bundle/ProductBundle/spec/Form/DataTransformer/VariantToCombinationTransformerSpec.php similarity index 94% rename from src/Sylius/Bundle/VariationBundle/spec/Form/DataTransformer/VariantToCombinationTransformerSpec.php rename to src/Sylius/Bundle/ProductBundle/spec/Form/DataTransformer/VariantToCombinationTransformerSpec.php index b4fbfcaa11..8e6881881a 100644 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/DataTransformer/VariantToCombinationTransformerSpec.php +++ b/src/Sylius/Bundle/ProductBundle/spec/Form/DataTransformer/VariantToCombinationTransformerSpec.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace spec\Sylius\Bundle\VariationBundle\Form\DataTransformer; +namespace spec\Sylius\Bundle\ProductBundle\Form\DataTransformer; use Doctrine\Common\Collections\Collection; use PhpSpec\ObjectBehavior; @@ -28,7 +28,7 @@ final class VariantToCombinationTransformerSpec extends ObjectBehavior function it_is_initializable() { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\DataTransformer\VariantToCombinationTransformer'); + $this->shouldHaveType('Sylius\Bundle\ProductBundle\Form\DataTransformer\VariantToCombinationTransformer'); } function it_is_a_form_data_transformer() diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/EventListener/BuildVariantFormSubscriberSpec.php b/src/Sylius/Bundle/ProductBundle/spec/Form/EventListener/BuildVariantFormSubscriberSpec.php similarity index 81% rename from src/Sylius/Bundle/VariationBundle/spec/Form/EventListener/BuildVariantFormSubscriberSpec.php rename to src/Sylius/Bundle/ProductBundle/spec/Form/EventListener/BuildVariantFormSubscriberSpec.php index 4c22c5693b..9bf64537ba 100644 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/EventListener/BuildVariantFormSubscriberSpec.php +++ b/src/Sylius/Bundle/ProductBundle/spec/Form/EventListener/BuildVariantFormSubscriberSpec.php @@ -9,9 +9,10 @@ * file that was distributed with this source code. */ -namespace spec\Sylius\Bundle\VariationBundle\Form\EventListener; +namespace spec\Sylius\Bundle\ProductBundle\Form\EventListener; use PhpSpec\ObjectBehavior; +use Sylius\Bundle\ProductBundle\Form\EventListener\BuildVariantFormSubscriber; use Sylius\Component\Product\Model\OptionInterface; use Sylius\Component\Product\Model\OptionValueInterface; use Sylius\Component\Product\Model\ProductInterface; @@ -21,27 +22,30 @@ use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Form\FormInterface; +/** + * @mixin BuildVariantFormSubscriber + */ final class BuildVariantFormSubscriberSpec extends ObjectBehavior { function let(FormFactoryInterface $factory) { - $this->beConstructedWith('variable_name', $factory); + $this->beConstructedWith($factory); } function it_is_initializable() { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\EventListener\BuildVariantFormSubscriber'); + $this->shouldHaveType(BuildVariantFormSubscriber::class); } function it_subscribes_to_event() { - $this::getSubscribedEvents()->shouldReturn( + static::getSubscribedEvents()->shouldReturn( [FormEvents::PRE_SET_DATA => 'preSetData'] ); } function it_adds_options_on_pre_set_data_event( - $factory, + FormFactoryInterface $factory, FormEvent $event, FormInterface $form, FormInterface $optionsForm, @@ -60,7 +64,7 @@ final class BuildVariantFormSubscriberSpec extends ObjectBehavior $factory->createNamed( 'options', - 'sylius_variable_name_option_value_collection', + 'sylius_product_option_value_collection', [$optionValue], [ 'options' => [$options], diff --git a/src/Sylius/Bundle/VariationBundle/spec/Validator/Constraint/VariantCombinationSpec.php b/src/Sylius/Bundle/ProductBundle/spec/Validator/Constraint/VariantCombinationSpec.php similarity index 80% rename from src/Sylius/Bundle/VariationBundle/spec/Validator/Constraint/VariantCombinationSpec.php rename to src/Sylius/Bundle/ProductBundle/spec/Validator/Constraint/VariantCombinationSpec.php index 20be540c9f..a12ed2dad5 100644 --- a/src/Sylius/Bundle/VariationBundle/spec/Validator/Constraint/VariantCombinationSpec.php +++ b/src/Sylius/Bundle/ProductBundle/spec/Validator/Constraint/VariantCombinationSpec.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace spec\Sylius\Bundle\VariationBundle\Validator\Constraint; +namespace spec\Sylius\Bundle\ProductBundle\Validator\Constraint; use PhpSpec\ObjectBehavior; use Symfony\Component\Validator\Constraint; @@ -21,7 +21,7 @@ final class VariantCombinationSpec extends ObjectBehavior { function it_is_initializable() { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Validator\Constraint\VariantCombination'); + $this->shouldHaveType('Sylius\Bundle\ProductBundle\Validator\Constraint\VariantCombination'); } function it_is_a_validation_constraint() diff --git a/src/Sylius/Bundle/VariationBundle/spec/Validator/Constraint/VariantUniqueSpec.php b/src/Sylius/Bundle/ProductBundle/spec/Validator/Constraint/VariantUniqueSpec.php similarity index 82% rename from src/Sylius/Bundle/VariationBundle/spec/Validator/Constraint/VariantUniqueSpec.php rename to src/Sylius/Bundle/ProductBundle/spec/Validator/Constraint/VariantUniqueSpec.php index decacc78bd..c2b54e5e2d 100644 --- a/src/Sylius/Bundle/VariationBundle/spec/Validator/Constraint/VariantUniqueSpec.php +++ b/src/Sylius/Bundle/ProductBundle/spec/Validator/Constraint/VariantUniqueSpec.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace spec\Sylius\Bundle\VariationBundle\Validator\Constraint; +namespace spec\Sylius\Bundle\ProductBundle\Validator\Constraint; use PhpSpec\ObjectBehavior; use Symfony\Component\Validator\Constraint; @@ -26,7 +26,7 @@ final class VariantUniqueSpec extends ObjectBehavior function it_is_initializable() { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Validator\Constraint\VariantUnique'); + $this->shouldHaveType('Sylius\Bundle\ProductBundle\Validator\Constraint\VariantUnique'); } function it_is_a_validation_constraint() diff --git a/src/Sylius/Bundle/VariationBundle/spec/Validator/VariantCombinationValidatorSpec.php b/src/Sylius/Bundle/ProductBundle/spec/Validator/VariantCombinationValidatorSpec.php similarity index 92% rename from src/Sylius/Bundle/VariationBundle/spec/Validator/VariantCombinationValidatorSpec.php rename to src/Sylius/Bundle/ProductBundle/spec/Validator/VariantCombinationValidatorSpec.php index 854f8b1689..c8b9a16148 100644 --- a/src/Sylius/Bundle/VariationBundle/spec/Validator/VariantCombinationValidatorSpec.php +++ b/src/Sylius/Bundle/ProductBundle/spec/Validator/VariantCombinationValidatorSpec.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace spec\Sylius\Bundle\VariationBundle\Validator; +namespace spec\Sylius\Bundle\ProductBundle\Validator; use Doctrine\Common\Collections\ArrayCollection; use PhpSpec\ObjectBehavior; use Prophecy\Argument; -use Sylius\Bundle\VariationBundle\Validator\Constraint\VariantCombination; +use Sylius\Bundle\ProductBundle\Validator\Constraint\VariantCombination; use Sylius\Component\Product\Model\OptionValueInterface; use Sylius\Component\Product\Model\ProductInterface; use Sylius\Component\Product\Model\VariantInterface; @@ -30,7 +30,7 @@ final class VariantCombinationValidatorSpec extends ObjectBehavior function it_is_initializable() { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Validator\VariantCombinationValidator'); + $this->shouldHaveType('Sylius\Bundle\ProductBundle\Validator\VariantCombinationValidator'); } function it_is_a_constraint_validator() diff --git a/src/Sylius/Bundle/VariationBundle/spec/Validator/VariantUniqueValidatorSpec.php b/src/Sylius/Bundle/ProductBundle/spec/Validator/VariantUniqueValidatorSpec.php similarity index 92% rename from src/Sylius/Bundle/VariationBundle/spec/Validator/VariantUniqueValidatorSpec.php rename to src/Sylius/Bundle/ProductBundle/spec/Validator/VariantUniqueValidatorSpec.php index 3910cb2fbf..9a2de5e257 100644 --- a/src/Sylius/Bundle/VariationBundle/spec/Validator/VariantUniqueValidatorSpec.php +++ b/src/Sylius/Bundle/ProductBundle/spec/Validator/VariantUniqueValidatorSpec.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace spec\Sylius\Bundle\VariationBundle\Validator; +namespace spec\Sylius\Bundle\ProductBundle\Validator; use PhpSpec\ObjectBehavior; use Prophecy\Argument; -use Sylius\Bundle\VariationBundle\Validator\Constraint\VariantUnique; +use Sylius\Bundle\ProductBundle\Validator\Constraint\VariantUnique; use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\Component\Product\Model\VariantInterface; use Symfony\Component\Validator\ConstraintValidator; @@ -34,7 +34,7 @@ final class VariantUniqueValidatorSpec extends ObjectBehavior function it_is_initializable() { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Validator\VariantUniqueValidator'); + $this->shouldHaveType('Sylius\Bundle\ProductBundle\Validator\VariantUniqueValidator'); } function it_is_a_constraint_validator() diff --git a/src/Sylius/Bundle/VariationBundle/.gitignore b/src/Sylius/Bundle/VariationBundle/.gitignore deleted file mode 100644 index 46aed33710..0000000000 --- a/src/Sylius/Bundle/VariationBundle/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -vendor/ -bin/ - -composer.phar -composer.lock diff --git a/src/Sylius/Bundle/VariationBundle/CHANGELOG.md b/src/Sylius/Bundle/VariationBundle/CHANGELOG.md deleted file mode 100644 index d97d309fa4..0000000000 --- a/src/Sylius/Bundle/VariationBundle/CHANGELOG.md +++ /dev/null @@ -1,6 +0,0 @@ -CHANGELOG -========= - -### v0.10.0 - -* Initial dev release. diff --git a/src/Sylius/Bundle/VariationBundle/DependencyInjection/Configuration.php b/src/Sylius/Bundle/VariationBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 649d48db03..0000000000 --- a/src/Sylius/Bundle/VariationBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,252 +0,0 @@ - - */ -class Configuration implements ConfigurationInterface -{ - /** - * {@inheritdoc} - */ - public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('sylius_variation'); - - $rootNode - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->end() - ->end() - ; - - $this->addClassesSection($rootNode); - - return $treeBuilder; - } - - /** - * @param ArrayNodeDefinition $node - */ - private function addClassesSection(ArrayNodeDefinition $node) - { - $node - ->children() - ->arrayNode('resources') - ->useAttributeAsKey('name') - ->prototype('array') - ->children() - ->scalarNode('variable')->isRequired()->cannotBeEmpty()->end() - ->arrayNode('variant') - ->isRequired() - ->addDefaultsIfNotSet() - ->children() - ->variableNode('options')->end() - ->arrayNode('classes') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('model')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('interface')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() - ->scalarNode('repository')->cannotBeEmpty()->end() - ->scalarNode('factory')->defaultValue(Factory::class)->end() - ->arrayNode('form') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('default')->defaultValue(VariantType::class)->cannotBeEmpty()->end() - ->scalarNode('from_identifier')->defaultValue(ResourceFromIdentifierType::class)->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ->end() - ->arrayNode('validation_groups') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('default') - ->prototype('scalar')->end() - ->defaultValue(['sylius']) - ->cannotBeEmpty() - ->end() - ->arrayNode('from_identifier') - ->prototype('scalar')->end() - ->defaultValue(['sylius']) - ->cannotBeEmpty() - ->end() - ->end() - ->end() - ->end() - ->end() - ->arrayNode('option') - ->isRequired() - ->addDefaultsIfNotSet() - ->children() - ->variableNode('options')->end() - ->arrayNode('classes') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('model')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('interface')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() - ->scalarNode('repository')->cannotBeEmpty()->end() - ->scalarNode('factory')->defaultValue(TranslatableFactory::class)->end() - ->arrayNode('form') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('default')->defaultValue(OptionType::class)->cannotBeEmpty()->end() - ->scalarNode('choice')->defaultValue(ResourceChoiceType::class)->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ->end() - ->arrayNode('validation_groups') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('default') - ->prototype('scalar')->end() - ->defaultValue(['sylius']) - ->cannotBeEmpty() - ->end() - ->end() - ->end() - ->arrayNode('translation') - ->isRequired() - ->addDefaultsIfNotSet() - ->children() - ->variableNode('options')->end() - ->arrayNode('classes') - ->isRequired() - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('model')->defaultValue(OptionTranslation::class)->cannotBeEmpty()->end() - ->scalarNode('interface')->defaultValue(OptionTranslationInterface::class)->cannotBeEmpty()->end() - ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() - ->scalarNode('repository')->cannotBeEmpty()->end() - ->scalarNode('factory')->defaultValue(Factory::class)->end() - ->arrayNode('form') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('default')->defaultValue(OptionTranslationType::class)->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ->end() - ->arrayNode('validation_groups') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('default') - ->prototype('scalar')->end() - ->defaultValue(['sylius']) - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->arrayNode('option_value') - ->isRequired() - ->addDefaultsIfNotSet() - ->children() - ->variableNode('options')->end() - ->arrayNode('classes') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('model')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('interface')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() - ->scalarNode('repository')->cannotBeEmpty()->cannotBeEmpty()->end() - ->scalarNode('factory')->defaultValue(TranslatableFactory::class)->cannotBeEmpty()->end() - ->arrayNode('form') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('default')->defaultValue(OptionValueType::class)->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ->end() - ->arrayNode('validation_groups') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('default') - ->prototype('scalar')->end() - ->defaultValue(['sylius']) - ->end() - ->end() - ->end() - ->arrayNode('translation') - ->isRequired() - ->addDefaultsIfNotSet() - ->children() - ->variableNode('option_value')->end() - ->arrayNode('classes') - ->isRequired() - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('model')->defaultValue(OptionValueTranslation::class)->cannotBeEmpty()->end() - ->scalarNode('interface')->defaultValue(OptionValueTranslationInterface::class)->cannotBeEmpty()->end() - ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() - ->scalarNode('repository')->cannotBeEmpty()->end() - ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end() - ->arrayNode('form') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('default')->defaultValue(OptionValueTranslationType::class)->cannotBeEmpty()->end() - ->end() - ->end() - ->end() - ->end() - ->arrayNode('validation_groups') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('default') - ->prototype('scalar')->end() - ->defaultValue(['sylius']) - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ; - } -} diff --git a/src/Sylius/Bundle/VariationBundle/DependencyInjection/SyliusVariationExtension.php b/src/Sylius/Bundle/VariationBundle/DependencyInjection/SyliusVariationExtension.php deleted file mode 100644 index 9257821a1d..0000000000 --- a/src/Sylius/Bundle/VariationBundle/DependencyInjection/SyliusVariationExtension.php +++ /dev/null @@ -1,144 +0,0 @@ - - */ -class SyliusVariationExtension extends AbstractResourceExtension -{ - /** - * {@inheritdoc} - */ - public function load(array $config, ContainerBuilder $container) - { - $config = $this->processConfiguration($this->getConfiguration($config, $container), $config); - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - - $this->registerResources('sylius', $config['driver'], $this->resolveResources($config['resources'], $container), $container); - - foreach ($config['resources'] as $variable => $parameters) { - $this->createvariableServices($container, $variable); - } - - foreach ($config['resources'] as $variableName => $variableConfig) { - foreach ($variableConfig as $resourceName => $resourceConfig) { - if (!is_array($resourceConfig)) { - continue; - } - - $formDefinition = $container->getDefinition('sylius.form.type.'.$variableName.'_'.$resourceName); - $formDefinition->addArgument($variableName); - - if (isset($resourceConfig['translation'])) { - $formTranslationDefinition = $container->getDefinition('sylius.form.type.'.$variableName.'_'.$resourceName.'_translation'); - $formTranslationDefinition->addArgument($variableName); - } - } - } - - $configFiles = [ - 'services.xml', - ]; - - foreach ($configFiles as $configFile) { - $loader->load($configFile); - } - } - - /** - * Resolve resources for every subject. - * - * @param array $resources - * @param ContainerBuilder $container - * - * @return array - */ - private function resolveResources(array $resources, ContainerBuilder $container) - { - $variables = []; - - foreach ($resources as $variable => $parameters) { - $variables[$variable] = $parameters; - } - - $container->setParameter('sylius.variation.variables', $variables); - - $resolvedResources = []; - - foreach ($resources as $variableName => $variableConfig) { - foreach ($variableConfig as $resourceName => $resourceConfig) { - if (is_array($resourceConfig)) { - $resolvedResources[$variableName.'_'.$resourceName] = $resourceConfig; - } - } - } - - return $resolvedResources; - } - - /** - * Create services for every variable object. - * - * @param ContainerBuilder $container - * @param string $variable - */ - private function createVariableServices(ContainerBuilder $container, $variable) - { - $variantAlias = $variable.'_variant'; - $optionValueAlias = $variable.'_option_value'; - - $variantChoiceFormType = new Definition(VariantChoiceType::class); - $variantChoiceFormType - ->setArguments([$variable]) - ->addTag('form.type', ['alias' => sprintf('sylius_%s_choice', $variantAlias)]) - ; - - $container->setDefinition('sylius.form.type.'.$variantAlias.'_choice', $variantChoiceFormType); - - $variantMatchFormType = new Definition(VariantMatchType::class); - $variantMatchFormType - ->setArguments([$variable]) - ->addTag('form.type', ['alias' => sprintf('sylius_%s_match', $variantAlias)]) - ; - - $container->setDefinition('sylius.form.type.'.$variantAlias.'_match', $variantMatchFormType); - - $optionValueChoiceFormType = new Definition(OptionValueChoiceType::class); - $optionValueChoiceFormType - ->setArguments([$variable]) - ->addTag('form.type', ['alias' => 'sylius_'.$optionValueAlias.'_choice']) - ; - - $container->setDefinition('sylius.form.type.'.$optionValueAlias.'_choice', $optionValueChoiceFormType); - - $optionValueCollectionFormType = new Definition(OptionValueCollectionType::class); - $optionValueCollectionFormType - ->setArguments([$variable]) - ->addTag('form.type', ['alias' => 'sylius_'.$optionValueAlias.'_collection']) - ; - - $container->setDefinition('sylius.form.type.'.$optionValueAlias.'_collection', $optionValueCollectionFormType); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/Form/ChoiceList/VariantChoiceList.php b/src/Sylius/Bundle/VariationBundle/Form/ChoiceList/VariantChoiceList.php deleted file mode 100644 index 8fdadfaab7..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Form/ChoiceList/VariantChoiceList.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ -class VariantChoiceList extends ObjectChoiceList -{ - /** - * @param ProductInterface $variable - */ - public function __construct(ProductInterface $variable) - { - parent::__construct($variable->getVariants(), 'name', [], null, 'id'); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/Form/Type/VariantType.php b/src/Sylius/Bundle/VariationBundle/Form/Type/VariantType.php deleted file mode 100644 index 6ae3a678ef..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Form/Type/VariantType.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ -class VariantType extends AbstractResourceType -{ - /** - * @var string - */ - protected $variableName; - - /** - * @param string $dataClass - * @param array $validationGroups - * @param string $variableName - */ - public function __construct($dataClass, array $validationGroups, $variableName) - { - parent::__construct($dataClass, $validationGroups); - - $this->variableName = $variableName; - } - - /** - * {@inheritdoc} - */ - public function buildForm(FormBuilderInterface $builder, array $options) - { - $builder - ->add('name', 'text', [ - 'required' => false, - 'label' => 'sylius.form.variant.name', - ]) - ->addEventSubscriber(new AddCodeFormSubscriber()) - ; - - $builder->addEventSubscriber(new BuildVariantFormSubscriber($this->variableName, $builder->getFormFactory())); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return sprintf('sylius_%s_variant', $this->variableName); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/README.md b/src/Sylius/Bundle/VariationBundle/README.md deleted file mode 100644 index bd81be7cf3..0000000000 --- a/src/Sylius/Bundle/VariationBundle/README.md +++ /dev/null @@ -1,74 +0,0 @@ -SyliusVariationBundle [![Build status...](https://secure.travis-ci.org/Sylius/SyliusVariationBundle.png?branch=master)](http://travis-ci.org/Sylius/SyliusVariationBundle) -===================== - -... - -Sylius ------- - -**Sylius** - Modern ecommerce for Symfony2. Visit [Sylius.org](http://sylius.org). - -[phpspec](http://phpspec.net) examples --------------------------------------- - -```bash -$ composer install -$ bin/phpspec run -fpretty -``` - -Documentation -------------- - -Documentation is available on [**docs.sylius.org**](http://docs.sylius.org/en/latest/bundles/SyliusVariationBundle/index.html). - -Contributing ------------- - -All informations about contributing to Sylius can be found on [this page](http://docs.sylius.org/en/latest/contributing/index.html). - -Mailing lists -------------- - -### Users - -Questions? Feel free to ask on [users mailing list](http://groups.google.com/group/sylius). - -### Developers - -To contribute and develop this bundle, use the [developers mailing list](http://groups.google.com/group/sylius-dev). - -Sylius twitter account ----------------------- - -If you want to keep up with updates, [follow the official Sylius account on twitter](http://twitter.com/Sylius). - -Bug tracking ------------- - -This bundle uses [GitHub issues](https://github.com/Sylius/Sylius/issues). -If you have found bug, please create an issue. - -Versioning ----------- - -Releases will be numbered with the format `major.minor.patch`. - -And constructed with the following guidelines. - -* Breaking backwards compatibility bumps the major. -* New additions without breaking backwards compatibility bumps the minor. -* Bug fixes and misc changes bump the patch. - -For more information on SemVer, please visit [semver.org website](http://semver.org/). -This versioning method is same for all **Sylius** bundles and applications. - -MIT License ------------ - -License can be found [here](https://github.com/Sylius/SyliusVariationBundle/blob/master/Resources/meta/LICENSE). - -Authors -------- - -The bundle was originally created by [Paweł Jędrzejewski](http://pjedrzejewski.com). -See the list of [contributors](https://github.com/Sylius/SyliusVariationBundle/contributors). diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/app/config.yml b/src/Sylius/Bundle/VariationBundle/Resources/config/app/config.yml deleted file mode 100644 index 3dfda1f248..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/app/config.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -jms_serializer: - metadata: - directories: - sylius-variation: - namespace_prefix: "Sylius\\Component\\Variation" - path: "@SyliusVariationBundle/Resources/config/serializer" diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/Option.orm.xml b/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/Option.orm.xml deleted file mode 100644 index 1f0ac9c505..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/Option.orm.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/OptionTranslation.orm.xml b/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/OptionTranslation.orm.xml deleted file mode 100644 index 32797e9ee8..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/OptionTranslation.orm.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/OptionValue.orm.xml b/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/OptionValue.orm.xml deleted file mode 100644 index 4cdcbd82a1..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/OptionValue.orm.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/OptionValueTranslation.orm.xml b/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/OptionValueTranslation.orm.xml deleted file mode 100644 index 81d3c1ba83..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/OptionValueTranslation.orm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/Variant.orm.xml b/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/Variant.orm.xml deleted file mode 100644 index 18a3587aa9..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/doctrine/model/Variant.orm.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/serializer/Model.Option.yml b/src/Sylius/Bundle/VariationBundle/Resources/config/serializer/Model.Option.yml deleted file mode 100644 index 317c7c75b0..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/serializer/Model.Option.yml +++ /dev/null @@ -1,10 +0,0 @@ -Sylius\Component\Product\Model\Option: - exclusion_policy: ALL - xml_root_name: option - properties: - code: - exopse: true - type: string - name: - expose: true - type: string diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/serializer/Model.OptionValue.yml b/src/Sylius/Bundle/VariationBundle/Resources/config/serializer/Model.OptionValue.yml deleted file mode 100644 index 6d030c4506..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/serializer/Model.OptionValue.yml +++ /dev/null @@ -1,13 +0,0 @@ -Sylius\Component\Product\Model\OptionValue: - exclusion_policy: ALL - xml_root_name: option-value - properties: - code: - expose: true - type: string - value: - expose: true - type: string - virtual_properties: - getName: - serialized_name: name diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/serializer/Model.Variant.yml b/src/Sylius/Bundle/VariationBundle/Resources/config/serializer/Model.Variant.yml deleted file mode 100644 index 22a80c0ac5..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/serializer/Model.Variant.yml +++ /dev/null @@ -1,13 +0,0 @@ -Sylius\Component\Product\Model\Variant: - exclusion_policy: ALL - xml_root_name: variant - properties: - id: - expose: true - type: integer - xml_attribute: true - presentation: - expose: true - type: string - options: - expose: true diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/services.xml b/src/Sylius/Bundle/VariationBundle/Resources/config/services.xml deleted file mode 100644 index dedbf3449b..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/services.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - Sylius\Bundle\VariationBundle\EventListener\LoadMetadataSubscriber - - Sylius\Bundle\VariationBundle\Validator\VariantUniqueValidator - Sylius\Bundle\VariationBundle\Validator\VariantCombinationValidator - - Sylius\Component\Product\Generator\VariantGenerator - - Sylius\Component\Product\Resolver\DefaultVariantResolver - - - - - - %sylius.variation.variables% - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Sylius/Bundle/VariationBundle/Resources/config/validation.xml b/src/Sylius/Bundle/VariationBundle/Resources/config/validation.xml deleted file mode 100644 index 3e3c69c6c1..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/config/validation.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Sylius/Bundle/VariationBundle/Resources/meta/LICENSE b/src/Sylius/Bundle/VariationBundle/Resources/meta/LICENSE deleted file mode 100644 index acd4c1958c..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/meta/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2016 Paweł Jędrzejewski - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ar.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ar.yml deleted file mode 100644 index 06570faac6..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ar.yml +++ /dev/null @@ -1,11 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: الاسم - option: - name: الاسم - option_value: - value: القيمة diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.be.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.be.yml deleted file mode 100644 index 14690f83cd..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.be.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Імя - option: - name: Імя - values: Магчымыя значэнні - option_value: - add_value: Дадаць значэнне - value: Значэнне diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.bg.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.bg.yml deleted file mode 100644 index a47a89f979..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.bg.yml +++ /dev/null @@ -1,10 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - option: - values: Възможни стойности - option_value: - add_value: Добавяне на стойност - value: Стойност diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ca.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ca.yml deleted file mode 100644 index 2dd55371b4..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ca.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Nom - option: - name: Nom diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.cs.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.cs.yml deleted file mode 100644 index 3aae9e821f..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.cs.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Jméno - option: - name: Jméno - values: Možné hodnoty - option_value: - add_value: Přidání hodnoty - value: Hodnota diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.da.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.da.yml deleted file mode 100644 index 81bf1f5679..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.da.yml +++ /dev/null @@ -1,11 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Navn - option: - name: Navn - option_value: - add_value: Tilføj værdi diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.de.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.de.yml deleted file mode 100644 index c1b9160924..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.de.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Name - option: - name: Name - values: Mögliche Werte - option_value: - add_value: Wert hinzufügen - value: Wert diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.de_CH.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.de_CH.yml deleted file mode 100644 index d89cc86072..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.de_CH.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Name - option: - name: Name diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.el.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.el.yml deleted file mode 100644 index 38d95f0303..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.el.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Ονομασία - option: - name: Ονομασία diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.en.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.en.yml deleted file mode 100644 index 5dcbe21d54..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.en.yml +++ /dev/null @@ -1,10 +0,0 @@ -sylius: - form: - variant: - name: Name - option: - name: Name - values: Possible values - option_value: - add_value: Add value - value: Value diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.es.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.es.yml deleted file mode 100644 index 9c9024bdb5..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.es.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Nombre - option: - name: Nombre - values: Valores posibles - option_value: - add_value: Añadir valor - value: Valor diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.fa.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.fa.yml deleted file mode 100644 index 74d8d4ff77..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.fa.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: نام - option: - name: نام - values: مقادیر قابل قبول - option_value: - add_value: افزودن مقدار - value: مقدار diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.fr.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.fr.yml deleted file mode 100644 index b5e68bb449..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.fr.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Nom - option: - name: Nom - values: Valeurs possibles - option_value: - add_value: Ajouter une valeur - value: Valeur diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.hr.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.hr.yml deleted file mode 100644 index b6e7810b3c..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.hr.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Naziv grupe - option: - name: Naziv grupe - values: Moguće vrijednosti - option_value: - add_value: Dodaj vrijednost - value: Vrijednost diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.hu.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.hu.yml deleted file mode 100644 index 1badd749f2..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.hu.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Név - option: - name: Név - values: Lehetséges értékek - option_value: - add_value: Adja hozzá az értéket - value: Érték diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.id.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.id.yml deleted file mode 100644 index 1f437e45f6..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.id.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Nama - option: - name: Nama diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.it.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.it.yml deleted file mode 100644 index 670f7b823f..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.it.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Nome - option: - name: Nome - values: Valori possibili - option_value: - add_value: Aggiungi valore - value: Valore diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ko.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ko.yml deleted file mode 100644 index 57ff8c1d15..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ko.yml +++ /dev/null @@ -1,7 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - option: - values: 예상값 diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.lt.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.lt.yml deleted file mode 100644 index 729102b96e..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.lt.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Pavadinimas - option: - name: Pavadinimas - values: Galimos reikšmės - option_value: - add_value: Pridėti reikšmę - value: Reikšmė diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.mk.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.mk.yml deleted file mode 100644 index 4e215285f8..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.mk.yml +++ /dev/null @@ -1,10 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - option: - values: Можни вредности - option_value: - add_value: Додај вредност - value: Вредност diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.nl.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.nl.yml deleted file mode 100644 index 346c78ff31..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.nl.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Naam - option: - name: Naam - values: Mogelijke waarden - option_value: - add_value: Waarde toevoegen - value: Waarde diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.no.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.no.yml deleted file mode 100644 index 06f2b05af8..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.no.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Navn - option: - name: Navn - values: Mulige verdier - option_value: - add_value: Legg til verdi - value: Verdi diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.pl.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.pl.yml deleted file mode 100644 index d1ef3bde67..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.pl.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Nazwa - option: - name: Nazwa - values: Możliwe wartości - option_value: - add_value: Dodaj wartość - value: Wartość diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.pt.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.pt.yml deleted file mode 100644 index 404d963951..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.pt.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Nome - option: - name: Nome - values: Valores possíveis - option_value: - add_value: Adicionar valor - value: Valor diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.pt_BR.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.pt_BR.yml deleted file mode 100644 index 404d963951..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.pt_BR.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Nome - option: - name: Nome - values: Valores possíveis - option_value: - add_value: Adicionar valor - value: Valor diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ro.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ro.yml deleted file mode 100644 index 6d30ab0a39..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ro.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Nume - option: - name: Nume - values: Valori posibile - option_value: - add_value: Adaugă valoare - value: Valoare diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ru.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ru.yml deleted file mode 100644 index d95cd3b972..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.ru.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Название - option: - name: Название - values: Возможные значения - option_value: - add_value: Добавить значение - value: Значение diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sk.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sk.yml deleted file mode 100644 index 39e8dc51ad..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sk.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Názov - option: - name: Názov - values: Možné hodnoty - option_value: - add_value: Pridať hodnotu - value: Hodnota diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sl.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sl.yml deleted file mode 100644 index caa010b1f4..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sl.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Ime - option: - name: Ime - values: Možne vrednosti - option_value: - add_value: Dodajte vrednost - value: Vrednost diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sq.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sq.yml deleted file mode 100644 index 24047a714c..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sq.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Emri - option: - name: Emri - values: Vlera të mundshme - option_value: - add_value: Shto vlerën - value: Vlera diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sr_CS.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sr_CS.yml deleted file mode 100644 index b5f280f323..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sr_CS.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Ime - option: - name: Ime diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sv.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sv.yml deleted file mode 100644 index 22a2514ea2..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.sv.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Namn - option: - name: Namn - values: Möjliga värden - option_value: - add_value: Lägg till värde - value: Värde diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.th.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.th.yml deleted file mode 100644 index 3b56b90f41..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.th.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: ชื่อ - option: - name: ชื่อ - values: ค่าที่เป็นไปได้ - option_value: - add_value: เพิ่มค่า - value: ค่า diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.tr.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.tr.yml deleted file mode 100644 index 9e0c7e279e..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.tr.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Ad - option: - name: Ad - values: Olası değerler - option_value: - add_value: Değer ekle - value: Değer diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.uk.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.uk.yml deleted file mode 100644 index 03234f8f2e..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.uk.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Ім’я - option: - name: Ім’я - values: Можливих значень - option_value: - add_value: Додати значення - value: Значення diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.vi.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.vi.yml deleted file mode 100644 index 8abe3f932c..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.vi.yml +++ /dev/null @@ -1,9 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: Tên - option: - name: Tên diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.zh_CN.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.zh_CN.yml deleted file mode 100644 index 816026a87f..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/messages.zh_CN.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - form: - variant: - name: 名称 - option: - name: 名称 - values: 可能的值 - option_value: - add_value: 添加值 - value: 值 diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.be.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.be.yml deleted file mode 100644 index eba9ff01d2..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.be.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - name: - not_blank: Калі ласка, увядзіце назву варыянта. - min_length: 'Назва варыянта павінна быць мінімум 1 сімвал.|Назва варыянта павінна быць мінімум {{ limit }} сімвалаў.' - max_length: 'Назва опцыі не павінна быць даўжэй за 1 сімвал.|Назва опцыі не павінна быць даўжэй за {{ limit }} сімвалаў.' - values: - min_count: 'Калі ласка, дадайце як мінімум {{ limit }} значэння опцыі.|Калі ласка, дадайце як мінімум {{ limit }} значэнняў опцый.' - option_value: - value: - not_blank: Калі ласка, увядзіце значэнне опцыі. - variant: - combination: Варыянт з такімі параметрамі ўжо існуе. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.cs.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.cs.yml deleted file mode 100644 index 993dd4a680..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.cs.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - name: - not_blank: Prosím zadejte název možnosti. - min_length: 'Název možnosti musí být nejméně 1 znak. |Název možnosti musí být alespoň {{ limit }} znaků.' - max_length: 'Název možnosti nesmí být delší než 1 znak. | Název možnosti nesmí být delší než {{ limit }} znaků.' - values: - min_count: 'Prosím přidejte alespoň {{ limit }} hodnotu možnosti.|Prosím vložte alespoň {{ limit }} hodnoty možností.' - option_value: - value: - not_blank: Vložte prosím hodnotu možnosti. - variant: - combination: Varianta s touto sadou možností již existuje. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.da.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.da.yml deleted file mode 100644 index 4a551784f9..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.da.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - name: - not_blank: Indtast egenskabens systemnavn. - min_length: 'Egenskabens systemnavn skal være mindst ét tegn langt.|Egenskabens systemnavn skal være mindst {{ limit }} tegn langt.' - max_length: 'Egenskabens system navn må ikke være længere end 1 tegn.|Egenskabens system navn må ikke være længere end {{ limit }} tegn.' - values: - min_count: 'Tilføj venligst mindst {{ limit }} egenskabsværdi. |Tilføj venligst mindst {{ limit }} egenskabsværdier.' - option_value: - value: - not_blank: Angiv egenskabens værdi. - variant: - combination: Variant med denne indstilling eksisterer allerede. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.de.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.de.yml deleted file mode 100644 index b9cd08b0cc..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.de.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Bitte geben Sie ein Kürzel für die Option an. - unique: Eine Option mit diesem Kürzel existiert bereits. - name: - not_blank: Bitte Optionsnamen eingeben. - min_length: 'Der Optionsname muss mindestens 1 Zeichen lang sein.|Der Optionsname muss mindestens {{ limit }} Zeichen lang sein.' - max_length: 'Der Optionsname darf nicht länger als 1 Zeichen sein.|Der Optionsname darf nicht länger als {{ limit }} Zeichen sein.' - values: - min_count: 'Bitte geben Sie mindestens {{ limit }} Wert für diese Option ein.|Bitte geben Sie mindestens {{ limit }} Werte für diese Option ein.' - option_value: - code: - not_blank: Bitte geben Sie ein Kürzel für den Wert der Option ein. - unique: Das Kürzel für den Wert der Option existiert bereits. - value: - not_blank: Bitte geben Sie einen Wert für diese Option ein. - variant: - combination: Die Variante mit den gewählten Einstellungen existiert schon. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.en.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.en.yml deleted file mode 100644 index 7207cf4e28..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.en.yml +++ /dev/null @@ -1,19 +0,0 @@ -sylius: - option: - code: - not_blank: Please enter option code. - unique: The option with given code already exists. - name: - not_blank: Please enter option name. - min_length: Option name must be at least 1 character long.|Option name must be at least {{ limit }} characters long. - max_length: Option name must not be longer than 1 character.|Option name must not be longer than {{ limit }} characters. - values: - min_count: Please add at least {{ limit }} option value.|Please add at least {{ limit }} option values. - option_value: - code: - not_blank: Please enter option value code. - unique: The option value with given code already exists. - value: - not_blank: Please enter option value. - variant: - combination: Variant with this option set already exists. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.es.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.es.yml deleted file mode 100644 index 3f745062c7..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.es.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Introduzca el código de opción. - unique: Ya existe una opción con ese código. - name: - not_blank: Por favor introduzca el nombre de la opción. - min_length: 'El nombre de la opción debe tener al menos 1 carácter.|El nombre de opción debe tener al menos {{ limit }} caracteres.' - max_length: 'El nombre de la opción debe tener como máximo 1 carácter.|El nombre de la opción no debe tener más de {{ limit }} caracteres.' - values: - min_count: 'Por favor añada al menos {{ limit }} valor para la opción.|Por favor añada al menos {{ limit }} valores para la opción.' - option_value: - code: - not_blank: Introduzca un valor de opción. - unique: Ya existe un valor de opción con ese código. - value: - not_blank: Por favor inserte un valor de opción. - variant: - combination: Ya existe una variante con este conjunto de opciones. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.fa.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.fa.yml deleted file mode 100644 index f2055a165a..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.fa.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: لطفا کد آپشن را وارد کنید. - unique: آپشنی با این کد قبلا در سیستم ثبت شده است. - name: - not_blank: لطفا نام آپشن را وارد کنید. - min_length: 'آپشن باید حداقل ۱ حرف داشته باشد| آپشن باید حداقل {{ limit }} حرف داشته باشد.' - max_length: 'آپشن نباید بیش از ۱ حرف باشد| آپشن نباید بیش از {{ limit }} حرف باشد.' - values: - min_count: 'حداقل {{ limit }} مقدار برای این آپشن تعریف کنید. | حداقل {{ limit }} مقدار برای این آپشن تعریف کنید.' - option_value: - code: - not_blank: لطفا کد مقدار را وارد کنید. - unique: مقداری برای آپشن با همین کد قبلا در سیستم ثبت شده است. - value: - not_blank: لطفا مقدار آپشن را وارد کنید. - variant: - combination: ترکیب کالایی با این آپشن قبلا در سیستم ثبت شده است. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.fr.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.fr.yml deleted file mode 100644 index ab4b0ee0cb..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.fr.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: "Entrez le code de l'option." - unique: "Le code de l'option existe déjà." - name: - not_blank: "Veuillez saisir le nom de l'option." - min_length: "Le nom de l'option doit contenir au moins 1 caractère.|Le nom de l'option ne doit pas dépasser les {{ limit }} caractères." - max_length: "Le nom de l'option ne doit pas dépasser 1 caractère.|Le nom de l'option ne doit pas dépasser les {{ limit }} caractères." - values: - min_count: "Veuillez ajouter au moins {{ limit }} valeur pour l'option.|Veuillez ajouter au moins {{ limit }} valeurs pour l'option." - option_value: - code: - not_blank: "Entrez la valeur de l'option." - unique: "La valeur de l'option existe déjà." - value: - not_blank: "Veuillez saisir la valeur de l'option." - variant: - combination: La variante avec cette option existe déjà. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.hr.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.hr.yml deleted file mode 100644 index f05acf3872..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.hr.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Unesite kod opcije. - unique: Opcija s unesenim kodom već postoji. - name: - not_blank: Unesite naziv svojstva. - min_length: 'Naziv svojstva mora imati najmanje jedan znak.|Naziv svojstva proizvoda mora imati najmanje {{ limit }} znakova.' - max_length: 'Naziv svojstva ne smije biti duži od jednog znaka.|Naziv svojstva ne smije biti duži od {{ limit }} znakova.' - values: - min_count: 'Unesite barem {{ limit }} opciju artikla.|nesite barem {{ limit }} opciju artikla.' - option_value: - code: - not_blank: Unesite vrijednost opcije koda. - unique: Vrijednost opcije unesenog koda već postoji. - value: - not_blank: Unesite vrijednost svojstva. - variant: - combination: Verzija sa ovim opcijama već postoji. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.hu.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.hu.yml deleted file mode 100644 index a0d87e823a..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.hu.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Kérjük, írja be az opció kódját. - unique: Az opció az adott kóddal már létezik. - name: - not_blank: Kérjük, adja meg az opció nevét. - min_length: 'Az opciónév legalább 1 karakter hosszú kell legyen. | Az opciónév legalább {{ limit }} karakter hosszú kell legyen.' - max_length: 'Az opciónév nem lehet hosszabb, mint 1 karakter. |Az opciónév nem lehet hosszabb, mint {{ limit }} karakterek.' - values: - min_count: 'Kérjük, adjon meg legalább {{ limit }} opció értéket. | Kérjük adjon meg legalább {{ limit }} opció értéket.' - option_value: - code: - not_blank: Kérjük adja meg az opció értékének kódját. - unique: Az opció értéke az adott kóddal már létezik. - value: - not_blank: Kérjük, adja meg az opció értékét. - variant: - combination: A változat ebben a választék készletben már létezik. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.it.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.it.yml deleted file mode 100644 index 36e59890ce..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.it.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: "Inserisci il codice dell'opzione." - unique: "L'opzione con il codice dato esiste già." - name: - not_blank: "Inserisci il nome dell'opzione." - min_length: "Il nome dell'opzione deve essere lungo almeno 1 carattere. |Il nome dell'opzione deve essere lungo almeno {{ limit }} caratteri." - max_length: "Il nome dell'opzione non deve essere più lungo di 1 carattere. |Il nome dell'opzione non deve essere più lungo di {{ limit }} caratteri." - values: - min_count: "Aggiungere almeno {{ limit }} valore d'opzione. |Aggiungere almeno {{ limit }} valori di opzione." - option_value: - code: - not_blank: "Inserisci il codice del valore dell'opzione." - unique: "Il valore dell'opzione con il codice dato esiste già." - value: - not_blank: "Inserisci il valore dell'opzione." - variant: - combination: La variante con questa opzione impostata esiste già. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.lt.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.lt.yml deleted file mode 100644 index b5ec846ffe..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.lt.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - name: - not_blank: Įveskite parinkties pavadinimą. - min_length: 'Parinkties pavadinimas turi būti ne mažiau kaip 1 simbolis.|Parinkties pavadinimas turi būti ne mažiau kaip {{ limit }} simbolių.' - max_length: 'Parinkties pavadinimas neturi būti ilgesnis kaip 1 simbolis.|Parinkties pavadinimas turi būti ilgesnis nei {{ limit }} simbolių.' - values: - min_count: 'Prašome įtraukti bent {{ limit }} parinkties reikšmę.|Prašome įtraukti bent {{ limit }} parinkties reikšmes.' - option_value: - value: - not_blank: Įveskite parinkties reikšmę. - variant: - combination: Variantas su šia parinktimi jau egzistuoja. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.nl.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.nl.yml deleted file mode 100644 index 8de83356ea..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.nl.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Voer een optiecode in. - unique: Er bestaat al een optie met deze code. - name: - not_blank: Voer een optie naam in. - min_length: 'Optie naam moet minstens 1 teken lang zijn.|Optie naam moet minstens {{ limit }} tekens lbevatten.' - max_length: 'Optie naam mag niet langer zijn dan 1 teken.|Optie naam mag niet langer zijn dan {{ limit }} tekens.' - values: - min_count: 'Voeg minstens {{ limit }} optie waarde toe.|Voeg minstens {{ limit }} optie waardes toe.' - option_value: - code: - not_blank: Voer een optiecode in. - unique: De optiewaarde met gegeven code bestaat al. - value: - not_blank: Voer een optie waarde in. - variant: - combination: Er bestaat al een variant met deze set opties. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.no.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.no.yml deleted file mode 100644 index be96cd20c8..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.no.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - name: - not_blank: Skriv inn navnet på alternativet. - min_length: 'Navnet må være minst ett tegn. |Navnet må være minst {{ limit }} tegn.' - max_length: 'Navnet kan ikke være lengre enn ett tegn. |Navnet kan ikke være lengre enn {{ limit }} tegn.' - values: - min_count: 'Legg til minst {{ limit }} alternativets verdi. |Legg til minst {{ limit }} alternativets verdi.' - option_value: - value: - not_blank: Angi verdi for alternativet. - variant: - combination: Variant med dette valget finnes allerede. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.pl.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.pl.yml deleted file mode 100644 index 8986e2a20b..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.pl.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Proszę wprowadzić kod opcji. - unique: Opcja z podanym kodem już istnieje. - name: - not_blank: Proszę wprowadzić nazwę opcji. - min_length: 'Nazwa opcji powinna być dłuższa niż jeden znak.|Nazwa opcji musi zawierać co najmniej {{ limit }} znaków.' - max_length: 'Nazwa opcji nie może być dłuższa niż jeden znak. |Nazwa opcji nie może przekraczać {{ limit }} znaków.' - values: - min_count: '{1} Dodaj co najmniej 1 opcję.|{2,3,4} Dodaj co najmniej {{ limit }} opcje.|[5,Inf[ Dodaj co najmniej {{ limit }} opcji.' - option_value: - code: - not_blank: Proszę wprowadzić kod wartości opcji. - unique: Wartość opcji z podanym kodem już istnieje. - value: - not_blank: Podaj wartość opcji. - variant: - combination: Wariant z tą opcją już istnieje. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.pt.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.pt.yml deleted file mode 100644 index f3e8ddaebc..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.pt.yml +++ /dev/null @@ -1,15 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Introduza o código de opção. - unique: Já existe uma opção com o código introduzido. - name: - not_blank: Introduza o nome da opção. - min_length: 'O nome da opção deve ter pelo menos 1 caracter.|O nome da opção deve ter pelo menos {{ limit }} caracteres.' - max_length: 'O nome da opção não deve ter mais que 1 caracter.|O nome da opção não deve ter mais que {{ limit }} caracteres.' - option_value: - value: - not_blank: Por favore insira uma opção válida. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.pt_BR.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.pt_BR.yml deleted file mode 100644 index 8febc242b8..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.pt_BR.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Por favor, digite o nome de opção. - unique: A opção com determinado código já existe. - name: - not_blank: Por favor, digite o nome de opção. - min_length: 'Nome da opção deve ter pelo menos 1 caracter. |Nome da opção deve ter pelo menos {{limit}} caracteres.' - max_length: 'Nome da opção não deve ser superior a 1 caractere. |Nome da opção não deve ter mais de {{limit}} caracteres.' - values: - min_count: 'Por favor, adicione pelo menos {{limite}} valores de opção. |Por favor, adicione pelo menos valores de opção de {{limit}}.' - option_value: - code: - not_blank: Por favor digite o valor do código opcional. - unique: O valor da opção com determinado código já existe. - value: - not_blank: Por favor, insira o valor de opção. - variant: - combination: Variante com esta opção definida já existe. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.ro.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.ro.yml deleted file mode 100644 index 291de110d4..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.ro.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - name: - not_blank: Vă rugăm să completați numele opţiunii. - min_length: 'Numele opţiunii trebuie să conţină cel puţin un caracter.|Numele opţiunii trebuie să conţină cel puţin {{ limit }} caractere.' - max_length: 'Numele opţiunii nu poate depăși un caracter.|Numele opţiunii nu poate depăși {{ limit }} de caractere.' - values: - min_count: 'Vă rugăm să adăugaţi cel puțin {{ limit }} valori pentru opțiune.|Vă rugăm să adăugaţi cel puțin {{ limit }} valori pentru opțiune.' - option_value: - value: - not_blank: Vă rugăm să completați valoarea opţiunii. - variant: - combination: O variantă cu acest set de opţiuni există deja. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.ru.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.ru.yml deleted file mode 100644 index bb030a40da..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.ru.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Пожалуйста введите код опции. - unique: Опция с таким кодом уже существует. - name: - not_blank: Пожалуйста введите название опции. - min_length: 'Название опции должно быть не менее 1 символа.|Название опции должно быть не менее {{ limit }} символов.' - max_length: 'Название опции должно быть длиннее 1 символа.|Название опции должно быть длиннее {{ limit }} символов.' - values: - min_count: 'Пожалуйста введите не менее {{ limit }} значения опции.|Пожалуйста введите не менее {{ limit }} значений опции.' - option_value: - code: - not_blank: Пожалуйста введите код значения опции. - unique: Значение опции с таким кодом уже существует. - value: - not_blank: Пожалуйста введите значение опции. - variant: - combination: Вариант с этой опцией уже существует. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.sk.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.sk.yml deleted file mode 100644 index cd1dd399af..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.sk.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Zadajte kód volby. - unique: Voľba zo zadaným kódom už existuje. - name: - not_blank: Prosím, zadajte názov voľby. - min_length: 'Názov voľby musí obsahovať aspoň 1 znak.|Názov voľby musí obsahovať aspoň {{ limit }} znakov.' - max_length: 'Názov voľby nesmie byť dlhší ako 1 znak.|Názov voľby nesmie byť dlhší ako {{ limit }} znakov.' - values: - min_count: 'Prosím pridajte aspoň {{ limit }} hodnotu pre voľbu. | Prosím pridajte aspoň {{ limit }} hodnôt pre voľby.' - option_value: - code: - not_blank: Prosím zadajte kód pre hodnotu voľby. - unique: Hodnota voľby zo zadaným kódom už existuje. - value: - not_blank: Prosím, zadajte hodnotu voľby. - variant: - combination: Variant s touto sadou produktových voľieb už existuje. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.sl.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.sl.yml deleted file mode 100644 index 4d967b97c4..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.sl.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Prosimo, vnesite kodo možnosti. - unique: Možnost z dano kodo že obstaja. - name: - not_blank: Prosimo, vnesite ime možnosti. - min_length: 'Ime možnosti mora biti dolgo vsaj 1 znak.|Ime možnost mora biti dolgo vsaj {{ limit }} znakov.' - max_length: 'Ime možnost ne sme biti daljše od 1 znaka.|Ime možnosti ne sme biti daljše od {{ limit }} znakov.' - values: - min_count: 'Prosimo, dodajte vsaj {{ limit }} vrednost možnosti.|Dodajte vsaj {{ limit }} vrednosti možnosti.' - option_value: - code: - not_blank: Prosimo, vnesite kodo vrednosti možnosti. - unique: Vrednost možnosti z dano kodo že obstaja. - value: - not_blank: Prosimo, vnesite vrednost možnosti. - variant: - combination: Varianta s tem naborom možnosti že obstaja. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.sq.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.sq.yml deleted file mode 100644 index 183fcb710f..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.sq.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: Shto kodin e opsionit. - unique: Opsioni me kodin e dhënë tashmë egziston. - name: - not_blank: Shkruaj emrin e opsionit. - min_length: 'Emri i opsionit duhet të përmbajë të paktën 1 karakter.|Emri i opsionit duhet të përmbajë të paktën {{ limit }} karaktere.' - max_length: 'Emri i opsionit nuk duhet të përmbajë më shumë se 1 karakter.|Emri i opsionit nuk duhet të përmbajë më shumë se {{ limit }} karaktere.' - values: - min_count: 'Shto të paktën {{ limit }} vlerë opsioni.|Shto të paktën {{ limit }} vlera opsioni.' - option_value: - code: - not_blank: Shto kodin e vlerës së opsionit. - unique: Vlera e opsionit me kodin e dhënë tashmë egziston. - value: - not_blank: Shkruaj vlerën e opsionit. - variant: - combination: Varianti me këtë grup opsionesh ekziston tashmë. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.th.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.th.yml deleted file mode 100644 index 82d779e2cf..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.th.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: กรุณาระบุรหัสตัวเลือก - unique: รหัสตัวเลือกนี้ถูกใช้งานแล้ว - name: - not_blank: กรุณาระบุชื่อตัวเลือก - min_length: 'ชื่อตัวเลือกต้องมีความยาวไม่น้อยกว่า 1 ตัวอักษร|ชื่อตัวเลือกต้องมีความยาวไม่น้อยกว่า {{ limit }} ตัวอักษร' - max_length: 'ชื่อตัวเลือกต้องมีความยาวไม่เกิน 1 ตัวอักษร|ชื่อตัวเลือกต้องมีความยาวไม่เกิน {{ limit }} ตัวอักษร' - values: - min_count: 'กรุณาระบุค่าของตัวเลือกอย่างน้อย {{ limit }} ค่า' - option_value: - code: - not_blank: กรุณาระบุรหัสตัวเลือก - unique: รหัสตัวเลือกนี้ถูกใช้งานแล้ว - value: - not_blank: กรุณาระบุค่าตัวเลือก - variant: - combination: มีการตั้งค่าสินค้าย่อยสำหรับตัวเลือกนี้แล้ว diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.tr.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.tr.yml deleted file mode 100644 index 299da8aa36..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.tr.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - name: - not_blank: Seçenek adı giriniz. - min_length: 'Seçenek adı en az 1 karakter uzunluğunda olmalıdır.|Seçenek adı en az {{ limit }} karakter uzunluğunda olmalıdır.' - max_length: 'Seçenek adı 1 karakterden uzun olmamalıdır.|Seçenek adı {{ limit }} karakterden uzun olmamalıdır.' - values: - min_count: 'Lütfen en az {{ limit }} seçenek ekleyin.|Lütfen en az {{ limit }} seçenek ekleyin.' - option_value: - value: - not_blank: Lütfen seçenek değeri girin. - variant: - combination: Bu seçenekli varyant zaten bulunmaktadır. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.uk.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.uk.yml deleted file mode 100644 index 81f6bb899b..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.uk.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - name: - not_blank: "Будь ласка, введіть ім'я параметра." - min_length: 'Назва опції має бути принаймні 1 символ.|Назва опції має бути принаймні {{ limit }} символів.' - max_length: 'Назва опції не має бути більшою за 1 символ.|Назва опції не має бути більше, ніж {{ limit }} символів.' - values: - min_count: 'Будь ласка, додайте принаймні {{ limit }} значення опції.|Будь ласка, додайте принаймні {{ limit }} значень опції.' - option_value: - value: - not_blank: Будь ласка, введіть значення опції. - variant: - combination: Варіант з таким набором опцій вже існує. diff --git a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.zh_CN.yml b/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.zh_CN.yml deleted file mode 100644 index f23019d4db..0000000000 --- a/src/Sylius/Bundle/VariationBundle/Resources/translations/validators.zh_CN.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This file is part of the Sylius package. -# (c) Paweł Jędrzejewski - -sylius: - option: - code: - not_blank: 请输入选项编号。 - unique: 给定代码的选项已存在。 - name: - not_blank: 请输入选项名称。 - min_length: '选项名称必须是至少 1 个字符长。 |选项名称必须至少 {{ limit }} 个字符长。' - max_length: '选项名称必须不能超过 1 个字符。 |选项名称不能超过 {{ limit }} 字符。' - values: - min_count: '请至少添加 {{ limit }} 选项限值。 |请至少添加 {{ limit }} 选项的限值。' - option_value: - code: - not_blank: 请输入选项值的代码。 - unique: 给定代码选项的值已存在。 - value: - not_blank: 请输入选项的值。 - variant: - combination: 变量与此选项设置已存在。 diff --git a/src/Sylius/Bundle/VariationBundle/SyliusVariationBundle.php b/src/Sylius/Bundle/VariationBundle/SyliusVariationBundle.php deleted file mode 100644 index f3fa370423..0000000000 --- a/src/Sylius/Bundle/VariationBundle/SyliusVariationBundle.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @author Gonzalo Vilaseca - */ -class SyliusVariationBundle extends AbstractResourceBundle -{ - /** - * {@inheritdoc} - */ - public function getSupportedDrivers() - { - return [ - SyliusResourceBundle::DRIVER_DOCTRINE_ORM, - ]; - } - - /** - * {@inheritdoc} - */ - protected function getModelNamespace() - { - return 'Sylius\Component\Product\Model'; - } -} diff --git a/src/Sylius/Bundle/VariationBundle/composer.json b/src/Sylius/Bundle/VariationBundle/composer.json deleted file mode 100644 index b4c2c8fab7..0000000000 --- a/src/Sylius/Bundle/VariationBundle/composer.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "sylius/variation-bundle", - "type": "symfony-bundle", - "description": "Managing object variations and options for Symfony2 applications.", - "keywords": ["shop", "ecommerce", "variation", "options", "variants"], - "homepage": "http://sylius.org", - "license": "MIT", - "authors": [ - { - "name": "Paweł Jędrzejewski", - "homepage": "http://pjedrzejewski.com" - }, - { - "name": "Sylius project", - "homepage": "http://sylius.org" - }, - { - "name": "Community contributions", - "homepage": "http://github.com/Sylius/Sylius/contributors" - } - ], - "require": { - "php": "^5.6|^7.0", - - "stof/doctrine-extensions-bundle": "~1.1", - "sylius/variation": "^1.0", - "sylius/resource-bundle": "^1.0", - "symfony/framework-bundle": "^2.8" - }, - "require-dev": { - "phpspec/phpspec": "^3.0", - "doctrine/orm": "^2.4.8,<2.5", - "symfony/form": "^2.8", - "symfony/validator": "^2.8" - }, - "config": { - "bin-dir": "bin" - }, - "autoload": { - "psr-4": { "Sylius\\Bundle\\VariationBundle\\": "" } - }, - "autoload-dev": { - "psr-4": { "Sylius\\Bundle\\VariationBundle\\spec\\": "spec/" } - }, - "minimum-stability": "dev", - "prefer-stable": true, - "repositories": [ - { - "type": "path", - "url": "../../*/*" - } - ], - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/src/Sylius/Bundle/VariationBundle/phpspec.yml.dist b/src/Sylius/Bundle/VariationBundle/phpspec.yml.dist deleted file mode 100644 index b4f630a7e1..0000000000 --- a/src/Sylius/Bundle/VariationBundle/phpspec.yml.dist +++ /dev/null @@ -1,5 +0,0 @@ -suites: - main: - namespace: Sylius\Bundle\VariationBundle - psr4_prefix: Sylius\Bundle\VariationBundle - src_path: . diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/ChoiceList/VariantChoiceListSpec.php b/src/Sylius/Bundle/VariationBundle/spec/Form/ChoiceList/VariantChoiceListSpec.php deleted file mode 100644 index a539a9f97f..0000000000 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/ChoiceList/VariantChoiceListSpec.php +++ /dev/null @@ -1,31 +0,0 @@ -getVariants()->shouldBeCalled()->willReturn([$variant]); - - $this->beConstructedWith($variable); - } - - function it_is_initializable() - { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\ChoiceList\VariantChoiceList'); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionTranslationTypeSpec.php b/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionTranslationTypeSpec.php deleted file mode 100644 index 4c59b5f46f..0000000000 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionTranslationTypeSpec.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ -final class OptionTranslationTypeSpec extends ObjectBehavior -{ - function let() - { - $this->beConstructedWith('Option', [], 'server'); - } - - function it_is_initializable() - { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\Type\OptionTranslationType'); - } - - function it_is_a_form_type() - { - $this->shouldImplement(FormTypeInterface::class); - } - - function it_builds_form_with_proper_fields(FormBuilder $builder) - { - $builder - ->add('name', 'text', Argument::any()) - ->willReturn($builder) - ; - - $this->buildForm($builder, []); - } - - function it_defines_assigned_data_class_and_validation_groups(OptionsResolver $resolver) - { - $resolver - ->setDefaults([ - 'data_class' => 'Option', - 'validation_groups' => [], - ]) - ->shouldBeCalled(); - - $this->configureOptions($resolver); - } - - function it_has_valid_name() - { - $this->getName()->shouldReturn('sylius_server_option_translation'); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionTypeSpec.php b/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionTypeSpec.php deleted file mode 100644 index 2f92e58721..0000000000 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionTypeSpec.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @author Gonzalo Vilaseca - */ -final class OptionTypeSpec extends ObjectBehavior -{ - function let() - { - $this->beConstructedWith('Option', [], 'server'); - } - - function it_is_initializable() - { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\Type\OptionType'); - } - - function it_is_a_form_type() - { - $this->shouldImplement(FormTypeInterface::class); - } - - function it_builds_form_with_proper_fields(FormBuilder $builder) - { - $builder - ->add('translations', 'sylius_translations', Argument::any()) - ->shouldBeCalled() - ->willReturn($builder) - ; - - $builder - ->add('values', 'collection', Argument::any()) - ->shouldBeCalled() - ->willReturn($builder) - ; - - $builder - ->addEventSubscriber(Argument::type(AddCodeFormSubscriber::class)) - ->shouldBeCalled() - ->willReturn($builder) - ; - - $this->buildForm($builder, []); - } - - function it_defines_assigned_data_class_and_validation_groups(OptionsResolver $resolver) - { - $resolver - ->setDefaults([ - 'data_class' => 'Option', - 'validation_groups' => [], - ]) - ->shouldBeCalled(); - - $this->configureOptions($resolver); - } - - function it_has_valid_name() - { - $this->getName()->shouldReturn('sylius_server_option'); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionValueChoiceTypeSpec.php b/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionValueChoiceTypeSpec.php deleted file mode 100644 index dc1f0de13a..0000000000 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionValueChoiceTypeSpec.php +++ /dev/null @@ -1,61 +0,0 @@ -beConstructedWith('variable_name'); - } - - function it_is_initializable() - { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\Type\OptionValueChoiceType'); - } - - function it_is_a_form_type() - { - $this->shouldImplement(FormTypeInterface::class); - } - - function it_has_options(OptionsResolver $resolver) - { - $resolver->setDefaults(Argument::withKey('choice_list'))->shouldBeCalled()->willReturn($resolver); - - $resolver->setRequired([ - 'option', - ])->shouldBeCalled()->willReturn($resolver); - - $resolver->addAllowedTypes([ - 'option' => OptionInterface::class, - ])->shouldBeCalled()->willReturn($resolver); - - $this->configureOptions($resolver); - } - - function it_has_a_parent() - { - $this->getParent()->shouldReturn('choice'); - } - - function it_has_a_name() - { - $this->getName()->shouldReturn('sylius_variable_name_option_value_choice'); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionValueCollectionTypeSpec.php b/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionValueCollectionTypeSpec.php deleted file mode 100644 index 55ab337702..0000000000 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionValueCollectionTypeSpec.php +++ /dev/null @@ -1,87 +0,0 @@ -beConstructedWith('variable_name'); - } - - function it_is_initializable() - { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\Type\OptionValueCollectionType'); - } - - function it_is_a_form_type() - { - $this->shouldImplement(FormTypeInterface::class); - } - - function it_builds_a_form_using_option_name_as_label_if_possible( - FormBuilderInterface $builder, - OptionInterface $option - ) { - $option->getId()->shouldBeCalled()->willReturn(3); - $option->getName()->shouldBeCalled()->willReturn('option_name'); - - $builder->add('3', 'sylius_variable_name_option_value_choice', [ - 'label' => 'option_name', - 'option' => $option, - 'property_path' => '[0]', - ])->shouldBeCalled(); - - $this->buildForm($builder, [ - 'options' => [$option], - ]); - } - - function it_builds_a_form_using_option_code_as_label_if_name_is_empty( - FormBuilderInterface $builder, - OptionInterface $option - ) { - $option->getId()->shouldBeCalled()->willReturn(3); - $option->getName()->shouldBeCalled()->willReturn(null); - $option->getCode()->shouldBeCalled()->willReturn('option_code'); - - $builder->add('3', 'sylius_variable_name_option_value_choice', [ - 'label' => 'option_code', - 'option' => $option, - 'property_path' => '[0]', - ])->shouldBeCalled(); - - $this->buildForm($builder, [ - 'options' => [$option], - ]); - } - - function it_has_options(OptionsResolver $resolver) - { - $resolver->setDefaults([ - 'options' => null, - ])->shouldBeCalled(); - - $this->configureOptions($resolver); - } - - function it_has_a_name() - { - $this->getName()->shouldReturn('sylius_variable_name_option_value_collection'); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionValueTypeSpec.php b/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionValueTypeSpec.php deleted file mode 100644 index f9b037e8b4..0000000000 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/OptionValueTypeSpec.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -final class OptionValueTypeSpec extends ObjectBehavior -{ - function let() - { - $this->beConstructedWith('OptionValue', [], 'server'); - } - - function it_is_initializable() - { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\Type\OptionValueType'); - } - - function it_is_a_form_type() - { - $this->shouldImplement(FormTypeInterface::class); - } - - function it_builds_form_with_value_field(FormBuilder $builder) - { - $builder - ->add('translations', 'sylius_translations', Argument::any()) - ->shouldBeCalled() - ->willReturn($builder) - ; - - $builder - ->addEventSubscriber(Argument::type(AddCodeFormSubscriber::class)) - ->shouldBeCalled() - ->willReturn($builder) - ; - - $this->buildForm($builder, []); - } - - function it_defines_assigned_data_class_and_validation_groups(OptionsResolver $resolver) - { - $resolver - ->setDefaults([ - 'data_class' => 'OptionValue', - 'validation_groups' => [], - ]) - ->shouldBeCalled(); - - $this->configureOptions($resolver); - } - - function it_has_valid_name() - { - $this->getName()->shouldReturn('sylius_server_option_value'); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/VariantChoiceTypeSpec.php b/src/Sylius/Bundle/VariationBundle/spec/Form/Type/VariantChoiceTypeSpec.php deleted file mode 100644 index f635aa3434..0000000000 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/VariantChoiceTypeSpec.php +++ /dev/null @@ -1,67 +0,0 @@ -beConstructedWith('variable_name'); - } - - function it_is_initializable() - { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\Type\VariantChoiceType'); - } - - function it_is_a_form_type() - { - $this->shouldImplement(FormTypeInterface::class); - } - - function it_builds_a_form(FormBuilderInterface $builder) - { - $builder->addViewTransformer(Argument::type( - CollectionToArrayTransformer::class - ))->shouldBeCalled(); - - $this->buildForm($builder, [ - 'multiple' => true, - ]); - } - - function it_has_options(OptionsResolver $resolver) - { - $resolver->setDefaults(Argument::withKey('choice_list'))->shouldBeCalled()->willReturn($resolver); - - $resolver->setRequired([ - 'variable', - ])->shouldBeCalled()->willReturn($resolver); - - $resolver->setAllowedTypes('variable', ProductInterface::class)->shouldBeCalled()->willReturn($resolver); - - $this->configureOptions($resolver); - } - - function it_has_a_name() - { - $this->getName()->shouldReturn('sylius_variable_name_variant_choice'); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/VariantMatchTypeSpec.php b/src/Sylius/Bundle/VariationBundle/spec/Form/Type/VariantMatchTypeSpec.php deleted file mode 100644 index 3fa28298c1..0000000000 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/VariantMatchTypeSpec.php +++ /dev/null @@ -1,74 +0,0 @@ -beConstructedWith('variable_name'); - } - - function it_is_initializable() - { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\Type\VariantMatchType'); - } - - function it_is_a_form_type() - { - $this->shouldImplement(FormTypeInterface::class); - } - - function it_builds_a_form(FormBuilderInterface $builder, ProductInterface $variable, OptionInterface $option) - { - $variable->getOptions()->shouldBeCalled()->willReturn([$option]); - $option->getName()->shouldBeCalled()->willReturn('option_name'); - $option->getCode()->shouldBeCalled()->willReturn('option-name-code'); - - $builder->add('option-name-code', 'sylius_variable_name_option_value_choice', [ - 'label' => 'option_name', - 'option' => $option, - 'property_path' => '[0]', - ])->shouldBeCalled(); - - $builder->addModelTransformer( - Argument::type(VariantToCombinationTransformer::class) - )->shouldBeCalled(); - - $this->buildForm($builder, ['variable' => $variable]); - } - - function it_has_options(OptionsResolver $resolver) - { - $resolver->setRequired([ - 'variable', - ])->shouldBeCalled()->willReturn($resolver); - - $resolver->setAllowedTypes('variable', ProductInterface::class)->shouldBeCalled()->willReturn($resolver); - - $this->configureOptions($resolver); - } - - function it_has_a_name() - { - $this->getName()->shouldReturn('sylius_variable_name_variant_match'); - } -} diff --git a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/VariantTypeSpec.php b/src/Sylius/Bundle/VariationBundle/spec/Form/Type/VariantTypeSpec.php deleted file mode 100644 index 60d8c97235..0000000000 --- a/src/Sylius/Bundle/VariationBundle/spec/Form/Type/VariantTypeSpec.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -final class VariantTypeSpec extends ObjectBehavior -{ - function let() - { - $this->beConstructedWith('Variant', [], 'server'); - } - - function it_is_initializable() - { - $this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\Type\VariantType'); - } - - function it_is_a_form_type() - { - $this->shouldImplement(FormTypeInterface::class); - } - - function it_has_valid_name() - { - $this->getName()->shouldReturn('sylius_server_variant'); - } -}