[Product] Merge VariationBundle to ProductBundle

This commit is contained in:
Kamil Kokot 2016-09-19 10:35:46 +02:00
parent c97c316efb
commit b11b6a8007
No known key found for this signature in database
GPG key ID: 7BD76F7054D93C89
140 changed files with 503 additions and 2829 deletions

View file

@ -160,5 +160,3 @@ Learn more:
* :doc:`Product - Bundle Documentation </bundles/SyliusProductBundle/index>` * :doc:`Product - Bundle Documentation </bundles/SyliusProductBundle/index>`
* :doc:`Product - Component Documentation </components/Product/index>` * :doc:`Product - Component Documentation </components/Product/index>`
* :doc:`Variation- Bundle Documentation </bundles/SyliusVariationBundle/index>`
* :doc:`Variation - Component Documentation </components/Variation/index>`

View file

@ -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. 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. 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 </bundles/SyliusVariationBundle/index>` which allows to manage
product variations with a very flexible architecture.
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
:numbered: :numbered:

View file

@ -41,7 +41,6 @@ Don't worry, everything was automatically installed via Composer.
new Sylius\Bundle\ProductBundle\SyliusProductBundle(), new Sylius\Bundle\ProductBundle\SyliusProductBundle(),
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(), new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(), new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
new Sylius\Bundle\VariationBundle\SyliusVariationBundle(),
// Other bundles... // Other bundles...
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),

View file

@ -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 } 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 } 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 } 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 } Behat: { namespace: Sylius\Behat, psr4_prefix: Sylius\Behat, spec_path: src/Sylius/Behat, src_path: src/Sylius/Behat }

View file

@ -41,7 +41,6 @@ class Kernel extends HttpKernel
new \Sylius\Bundle\LocaleBundle\SyliusLocaleBundle(), new \Sylius\Bundle\LocaleBundle\SyliusLocaleBundle(),
new \Sylius\Bundle\ProductBundle\SyliusProductBundle(), new \Sylius\Bundle\ProductBundle\SyliusProductBundle(),
new \Sylius\Bundle\ChannelBundle\SyliusChannelBundle(), new \Sylius\Bundle\ChannelBundle\SyliusChannelBundle(),
new \Sylius\Bundle\VariationBundle\SyliusVariationBundle(),
new \Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(), new \Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
new \Sylius\Bundle\TaxationBundle\SyliusTaxationBundle(), new \Sylius\Bundle\TaxationBundle\SyliusTaxationBundle(),
new \Sylius\Bundle\ShippingBundle\SyliusShippingBundle(), new \Sylius\Bundle\ShippingBundle\SyliusShippingBundle(),

View file

@ -18,7 +18,6 @@ imports:
- { resource: "@SyliusTaxationBundle/Resources/config/app/config.yml" } - { resource: "@SyliusTaxationBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusTaxonomyBundle/Resources/config/app/config.yml" } - { resource: "@SyliusTaxonomyBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusUserBundle/Resources/config/app/config.yml" } - { resource: "@SyliusUserBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusVariationBundle/Resources/config/app/config.yml" }
- { resource: "parameters.yml" } - { resource: "parameters.yml" }
- { resource: "sylius.yml" } - { resource: "sylius.yml" }

View file

@ -142,6 +142,13 @@ sylius_product:
model: Sylius\Component\Core\Model\ProductTranslation model: Sylius\Component\Core\Model\ProductTranslation
form: form:
default: Sylius\Bundle\CoreBundle\Form\Type\ProductTranslationType 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: sylius_promotion:
resources: resources:
@ -249,13 +256,3 @@ sylius_customer:
repository: Sylius\Bundle\CoreBundle\Doctrine\ORM\CustomerRepository repository: Sylius\Bundle\CoreBundle\Doctrine\ORM\CustomerRepository
form: form:
default: Sylius\Bundle\CoreBundle\Form\Type\CustomerType 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

View file

@ -12,7 +12,7 @@
namespace spec\Sylius\Bundle\CoreBundle\Form\Type; namespace spec\Sylius\Bundle\CoreBundle\Form\Type;
use PhpSpec\ObjectBehavior; use PhpSpec\ObjectBehavior;
use Sylius\Bundle\VariationBundle\Form\Type\VariantType; use Sylius\Bundle\ProductBundle\Form\Type\VariantType;
use Symfony\Component\Form\FormTypeInterface; use Symfony\Component\Form\FormTypeInterface;
final class ProductVariantTypeSpec extends ObjectBehavior final class ProductVariantTypeSpec extends ObjectBehavior

View file

@ -15,15 +15,32 @@ use Sylius\Bundle\CoreBundle\Form\Type\LegacyProductType;
use Sylius\Bundle\ProductBundle\Form\Type\ProductTranslationType; use Sylius\Bundle\ProductBundle\Form\Type\ProductTranslationType;
use Sylius\Bundle\ProductBundle\Form\Type\ProductType; use Sylius\Bundle\ProductBundle\Form\Type\ProductType;
use Sylius\Bundle\ProductBundle\Form\Type\ProductVariantGenerationType; use Sylius\Bundle\ProductBundle\Form\Type\ProductVariantGenerationType;
use Sylius\Bundle\ProductBundle\Form\Type\VariantType;
use Sylius\Bundle\ResourceBundle\Controller\ResourceController; use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
use Sylius\Bundle\ResourceBundle\Form\Type\ResourceChoiceType; use Sylius\Bundle\ResourceBundle\Form\Type\ResourceChoiceType;
use Sylius\Bundle\ResourceBundle\Form\Type\ResourceFromIdentifierType;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle; 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\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\Product;
use Sylius\Component\Product\Model\ProductInterface; use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Product\Model\ProductTranslation; use Sylius\Component\Product\Model\ProductTranslation;
use Sylius\Component\Product\Model\ProductTranslationInterface; 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\Factory;
use Sylius\Component\Resource\Factory\TranslatableFactory;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\ConfigurationInterface;
@ -135,6 +152,171 @@ class Configuration implements ConfigurationInterface
->end() ->end()
->end() ->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() ->end()
->end() ->end()

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Product\Repository\OptionRepositoryInterface; use Sylius\Component\Product\Repository\OptionRepositoryInterface;

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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\EventSubscriber;
use Doctrine\Common\Persistence\Mapping\ClassMetadata; use Doctrine\Common\Persistence\Mapping\ClassMetadata;

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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\OptionValueInterface;
use Sylius\Component\Product\Model\ProductInterface; use Sylius\Component\Product\Model\ProductInterface;
@ -18,25 +18,21 @@ use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\UnexpectedTypeException; use Symfony\Component\Form\Exception\UnexpectedTypeException;
/** /**
* Option values combination to variant transformer.
*
* @author Paweł Jędrzejewski <pawel@sylius.org> * @author Paweł Jędrzejewski <pawel@sylius.org>
*/ */
class VariantToCombinationTransformer implements DataTransformerInterface class VariantToCombinationTransformer implements DataTransformerInterface
{ {
/** /**
* Currently matching variable.
*
* @var ProductInterface * @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) private function matches($value)
{ {
foreach ($this->variable->getVariants() as $variant) { foreach ($this->product->getVariants() as $variant) {
foreach ($value as $option) { foreach ($value as $option) {
if (null === $option || !$variant->hasOption($option)) { if (null !== $option && $variant->hasOption($option)) {
continue 2;
}
}
return $variant; return $variant;
} }
}
}
return; return null;
} }
} }

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
@ -23,23 +23,16 @@ use Symfony\Component\Form\FormFactoryInterface;
*/ */
class BuildVariantFormSubscriber implements EventSubscriberInterface class BuildVariantFormSubscriber implements EventSubscriberInterface
{ {
/**
* @var string
*/
protected $variableName;
/** /**
* @var FormFactoryInterface * @var FormFactoryInterface
*/ */
private $factory; private $factory;
/** /**
* @param string $variableName
* @param FormFactoryInterface $factory * @param FormFactoryInterface $factory
*/ */
public function __construct($variableName, FormFactoryInterface $factory) public function __construct(FormFactoryInterface $factory)
{ {
$this->variableName = $variableName;
$this->factory = $factory; $this->factory = $factory;
} }
@ -70,7 +63,7 @@ class BuildVariantFormSubscriber implements EventSubscriberInterface
// If the object has options, lets add this configuration field. // If the object has options, lets add this configuration field.
if ($variable->hasOptions()) { 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(), 'options' => $variable->getOptions(),
'auto_initialize' => false, 'auto_initialize' => false,
])); ]));

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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 Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
@ -19,23 +19,6 @@ use Symfony\Component\Form\FormBuilderInterface;
*/ */
class OptionTranslationType extends AbstractResourceType 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} * {@inheritdoc}
*/ */
@ -53,6 +36,6 @@ class OptionTranslationType extends AbstractResourceType
*/ */
public function getName() public function getName()
{ {
return sprintf('sylius_%s_option_translation', $this->variableName); return 'sylius_product_option_translation';
} }
} }

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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\EventSubscriber\AddCodeFormSubscriber;
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
@ -21,23 +21,6 @@ use Symfony\Component\Form\FormBuilderInterface;
*/ */
class OptionType extends AbstractResourceType 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} * {@inheritdoc}
*/ */
@ -45,11 +28,11 @@ class OptionType extends AbstractResourceType
{ {
$builder $builder
->add('translations', 'sylius_translations', [ ->add('translations', 'sylius_translations', [
'type' => sprintf('sylius_%s_option_translation', $this->variableName), 'type' => 'sylius_product_option_translation',
'label' => 'sylius.form.option.name', 'label' => 'sylius.form.option.name',
]) ])
->add('values', 'collection', [ ->add('values', 'collection', [
'type' => sprintf('sylius_%s_option_value', $this->variableName), 'type' => 'sylius_product_option_value',
'allow_add' => true, 'allow_add' => true,
'allow_delete' => true, 'allow_delete' => true,
'by_reference' => false, 'by_reference' => false,
@ -65,6 +48,6 @@ class OptionType extends AbstractResourceType
*/ */
public function getName() public function getName()
{ {
return sprintf('sylius_%s_option', $this->variableName); return 'sylius_product_option';
} }
} }

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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 Sylius\Component\Product\Model\OptionInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
@ -23,19 +23,6 @@ use Symfony\Component\PropertyAccess\PropertyAccess;
*/ */
class OptionValueChoiceType extends AbstractType class OptionValueChoiceType extends AbstractType
{ {
/**
* @var string
*/
protected $variableName;
/**
* @param string $variableName
*/
public function __construct($variableName)
{
$this->variableName = $variableName;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
@ -79,6 +66,6 @@ class OptionValueChoiceType extends AbstractType
*/ */
public function getName() public function getName()
{ {
return sprintf('sylius_%s_option_value_choice', $this->variableName); return 'sylius_product_option_value_choice';
} }
} }

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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 Sylius\Component\Product\Model\OptionInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
@ -27,39 +27,17 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
*/ */
class OptionValueCollectionType extends AbstractType class OptionValueCollectionType extends AbstractType
{ {
/**
* @var string
*/
protected $variableName;
/**
* @param string $variableName
*/
public function __construct($variableName)
{
$this->variableName = $variableName;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function buildForm(FormBuilderInterface $builder, array $options) 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) { foreach ($options['options'] as $i => $option) {
if (!$option instanceof OptionInterface) { if (!$option instanceof OptionInterface) {
throw new InvalidConfigurationException('Each object passed as option list must implement "Sylius\Component\Product\Model\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(), 'label' => $option->getName() ?: $option->getCode(),
'option' => $option, 'option' => $option,
'property_path' => '['.$i.']', 'property_path' => '['.$i.']',
@ -73,9 +51,8 @@ class OptionValueCollectionType extends AbstractType
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver $resolver
->setDefaults([ ->setRequired('options')
'options' => null, ->setAllowedTypes('options', 'array')
])
; ;
} }
@ -84,6 +61,6 @@ class OptionValueCollectionType extends AbstractType
*/ */
public function getName() public function getName()
{ {
return sprintf('sylius_%s_option_value_collection', $this->variableName); return 'sylius_product_option_value_collection';
} }
} }

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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 Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
@ -19,22 +19,6 @@ use Symfony\Component\Form\FormBuilderInterface;
*/ */
class OptionValueTranslationType extends AbstractResourceType 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} * {@inheritdoc}
*/ */
@ -52,6 +36,6 @@ class OptionValueTranslationType extends AbstractResourceType
*/ */
public function getName() public function getName()
{ {
return sprintf('sylius_%s_option_value_translation', $this->variableName); return 'sylius_product_option_value_translation';
} }
} }

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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\EventSubscriber\AddCodeFormSubscriber;
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
@ -20,23 +20,6 @@ use Symfony\Component\Form\FormBuilderInterface;
*/ */
class OptionValueType extends AbstractResourceType 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} * {@inheritdoc}
*/ */
@ -44,7 +27,7 @@ class OptionValueType extends AbstractResourceType
{ {
$builder $builder
->add('translations', 'sylius_translations', [ ->add('translations', 'sylius_translations', [
'type' => sprintf('sylius_%s_option_value_translation', $this->variableName), 'type' => 'sylius_product_option_value_translation',
'label' => 'sylius.form.option.name', 'label' => 'sylius.form.option.name',
]) ])
->addEventSubscriber(new AddCodeFormSubscriber()) ->addEventSubscriber(new AddCodeFormSubscriber())
@ -56,6 +39,6 @@ class OptionValueType extends AbstractResourceType
*/ */
public function getName() public function getName()
{ {
return sprintf('sylius_%s_option_value', $this->variableName); return 'sylius_product_option_value';
} }
} }

View file

@ -9,12 +9,12 @@
* file that was distributed with this source code. * 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 Sylius\Component\Product\Model\ProductInterface;
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer; use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@ -24,19 +24,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
*/ */
class VariantChoiceType extends AbstractType class VariantChoiceType extends AbstractType
{ {
/**
* @var string
*/
protected $variableName;
/**
* @param string $variableName
*/
public function __construct($variableName)
{
$this->variableName = $variableName;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
@ -53,7 +40,7 @@ class VariantChoiceType extends AbstractType
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$choiceList = function (Options $options) { $choiceList = function (Options $options) {
return new VariantChoiceList($options['variable']); return new ObjectChoiceList($options['product']->getVariants(), 'name', [], null, 'id');
}; };
$resolver $resolver
@ -64,9 +51,9 @@ class VariantChoiceType extends AbstractType
'choice_list' => $choiceList, 'choice_list' => $choiceList,
]) ])
->setRequired([ ->setRequired([
'variable', 'product',
]) ])
->setAllowedTypes('variable', ProductInterface::class) ->setAllowedTypes('product', ProductInterface::class)
; ;
} }
@ -83,6 +70,6 @@ class VariantChoiceType extends AbstractType
*/ */
public function getName() public function getName()
{ {
return sprintf('sylius_%s_variant_choice', $this->variableName); return 'sylius_product_variant_choice';
} }
} }

View file

@ -9,10 +9,10 @@
* file that was distributed with this source code. * 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 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 Sylius\Component\Product\Model\ProductInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
@ -23,33 +23,20 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
*/ */
class VariantMatchType extends AbstractType class VariantMatchType extends AbstractType
{ {
/**
* @var string
*/
protected $variableName;
/**
* @param string $variableName
*/
public function __construct($variableName)
{
$this->variableName = $variableName;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
foreach ($options['variable']->getOptions() as $i => $option) { foreach ($options['product']->getOptions() as $i => $option) {
$builder->add($option->getCode(), sprintf('sylius_%s_option_value_choice', $this->variableName), [ $builder->add($option->getCode(), 'sylius_product_option_value_choice', [
'label' => $option->getName(), 'label' => $option->getName(),
'option' => $option, 'option' => $option,
'property_path' => '['.$i.']', '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) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver $resolver
->setRequired([ ->setRequired('product')
'variable', ->setAllowedTypes('product', ProductInterface::class)
])
->setAllowedTypes('variable', ProductInterface::class)
; ;
} }
@ -70,6 +55,6 @@ class VariantMatchType extends AbstractType
*/ */
public function getName() public function getName()
{ {
return sprintf('sylius_%s_variant_match', $this->variableName); return 'sylius_product_variant_match';
} }
} }

View file

@ -11,24 +11,27 @@
namespace Sylius\Bundle\ProductBundle\Form\Type; 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\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
/** /**
* Product variant form type.
*
* @author Paweł Jędrzejewski <pawel@sylius.org> * @author Paweł Jędrzejewski <pawel@sylius.org>
*/ */
class VariantType extends BaseVariantType class VariantType extends AbstractResourceType
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
parent::buildForm($builder, $options);
$builder $builder
->add('name', 'text', [
'required' => false,
'label' => 'sylius.form.variant.name',
])
->add('availableOn', 'datetime', [ ->add('availableOn', 'datetime', [
'required' => false, 'required' => false,
'date_widget' => 'single_text', 'date_widget' => 'single_text',
@ -41,6 +44,17 @@ class VariantType extends BaseVariantType
'time_widget' => 'single_text', 'time_widget' => 'single_text',
'label' => 'sylius.form.product_variant.available_until', 'label' => 'sylius.form.product_variant.available_until',
]) ])
->addEventSubscriber(new AddCodeFormSubscriber())
; ;
$builder->addEventSubscriber(new BuildVariantFormSubscriber($builder->getFormFactory()));
}
/**
* {@inheritdoc}
*/
public function getName()
{
return 'sylius_product_variant';
} }
} }

View file

@ -11,8 +11,25 @@
--> -->
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
>
<mapped-superclass name="Sylius\Component\Product\Model\Option" table="sylius_product_option" /> <mapped-superclass name="Sylius\Component\Product\Model\Option" table="sylius_product_option">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="code" column="code" type="string" unique="true" />
<field name="createdAt" column="created_at" type="datetime">
<gedmo:timestampable on="create"/>
</field>
<field name="updatedAt" column="updated_at" type="datetime" nullable="true">
<gedmo:timestampable on="update"/>
</field>
</mapped-superclass>
</doctrine-mapping> </doctrine-mapping>

View file

@ -13,6 +13,12 @@
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping">
<mapped-superclass name="Sylius\Component\Product\Model\OptionTranslation" table="sylius_product_option_translation" /> <mapped-superclass name="Sylius\Component\Product\Model\OptionTranslation" table="sylius_product_option_translation">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="name" column="name" type="string" />
</mapped-superclass>
</doctrine-mapping> </doctrine-mapping>

View file

@ -14,6 +14,11 @@
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping">
<mapped-superclass name="Sylius\Component\Product\Model\OptionValue" table="sylius_product_option_value"> <mapped-superclass name="Sylius\Component\Product\Model\OptionValue" table="sylius_product_option_value">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="code" column="code" type="string" unique="true" />
</mapped-superclass> </mapped-superclass>
</doctrine-mapping> </doctrine-mapping>

View file

@ -13,6 +13,12 @@
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"> <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping">
<mapped-superclass name="Sylius\Component\Product\Model\OptionValueTranslation" table="sylius_product_option_value_translation" /> <mapped-superclass name="Sylius\Component\Product\Model\OptionValueTranslation" table="sylius_product_option_value_translation">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="value" column="value" type="string" />
</mapped-superclass>
</doctrine-mapping> </doctrine-mapping>

View file

@ -14,9 +14,26 @@
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
>
<mapped-superclass name="Sylius\Component\Product\Model\Variant" table="sylius_product_variant"> <mapped-superclass name="Sylius\Component\Product\Model\Variant" table="sylius_product_variant">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="code" column="code" type="string" unique="true" nullable="false"/>
<field name="name" column="name" type="string" nullable="true" />
<field name="createdAt" column="created_at" type="datetime">
<gedmo:timestampable on="create"/>
</field>
<field name="updatedAt" column="updated_at" type="datetime" nullable="true">
<gedmo:timestampable on="update"/>
</field>
<field name="availableOn" column="available_on" type="datetime" nullable="true" /> <field name="availableOn" column="available_on" type="datetime" nullable="true" />
<field name="availableUntil" column="available_until" type="datetime" nullable="true" /> <field name="availableUntil" column="available_until" type="datetime" nullable="true" />
</mapped-superclass> </mapped-superclass>

View file

@ -18,7 +18,7 @@
<parameters> <parameters>
<parameter key="sylius.repository.product_attribute.class">Sylius\Bundle\AttributeBundle\Doctrine\ORM\AttributeRepository</parameter> <parameter key="sylius.repository.product_attribute.class">Sylius\Bundle\AttributeBundle\Doctrine\ORM\AttributeRepository</parameter>
<parameter key="sylius.repository.product_option.class">Sylius\Bundle\VariationBundle\Doctrine\ORM\OptionRepository</parameter> <parameter key="sylius.repository.product_option.class">Sylius\Bundle\ProductBundle\Doctrine\ORM\OptionRepository</parameter>
</parameters> </parameters>
</container> </container>

View file

@ -1,3 +1,10 @@
Sylius\Component\Product\Model\Option: Sylius\Component\Product\Model\Option:
exclusion_policy: ALL exclusion_policy: ALL
xml_root_name: option xml_root_name: option
properties:
code:
exopse: true
type: string
name:
expose: true
type: string

View file

@ -1,3 +1,13 @@
Sylius\Component\Product\Model\OptionValue: Sylius\Component\Product\Model\OptionValue:
exclusion_policy: ALL exclusion_policy: ALL
xml_root_name: option-value xml_root_name: option-value
properties:
code:
expose: true
type: string
value:
expose: true
type: string
virtual_properties:
getName:
serialized_name: name

View file

@ -1,3 +1,13 @@
Sylius\Component\Product\Model\Variant: Sylius\Component\Product\Model\Variant:
exclusion_policy: ALL exclusion_policy: ALL
xml_root_name: variant xml_root_name: variant
properties:
id:
expose: true
type: integer
xml_attribute: true
presentation:
expose: true
type: string
options:
expose: true

View file

@ -22,6 +22,15 @@
<parameter key="sylius.validator.product.unique.class">Sylius\Bundle\ProductBundle\Validator\ProductUniqueValidator</parameter> <parameter key="sylius.validator.product.unique.class">Sylius\Bundle\ProductBundle\Validator\ProductUniqueValidator</parameter>
<parameter key="sylius.form.listener.product_variant_generator.class">Sylius\Bundle\ProductBundle\Form\EventSubscriber\GenerateProductVariantsSubscriber</parameter> <parameter key="sylius.form.listener.product_variant_generator.class">Sylius\Bundle\ProductBundle\Form\EventSubscriber\GenerateProductVariantsSubscriber</parameter>
<parameter key="sylius.event_subscriber.variation.load_metadata.class">Sylius\Bundle\ProductBundle\EventListener\LoadMetadataSubscriber</parameter>
<parameter key="sylius.validator.variant.unique.class">Sylius\Bundle\ProductBundle\Validator\VariantUniqueValidator</parameter>
<parameter key="sylius.validator.variant.combination.class">Sylius\Bundle\ProductBundle\Validator\VariantCombinationValidator</parameter>
<parameter key="sylius.generator.variant.class">Sylius\Component\Product\Generator\VariantGenerator</parameter>
<parameter key="sylius.variant_resolver.default.class">Sylius\Component\Product\Resolver\DefaultVariantResolver</parameter>
</parameters> </parameters>
<services> <services>
@ -35,6 +44,28 @@
<service id="sylius.form.listener.product_variant_generator" class="%sylius.form.listener.product_variant_generator.class%"> <service id="sylius.form.listener.product_variant_generator" class="%sylius.form.listener.product_variant_generator.class%">
<argument type="service" id="sylius.generator.variant" /> <argument type="service" id="sylius.generator.variant" />
</service> </service>
<service id="sylius.event_subscriber.variation.load_metadata" class="%sylius.event_subscriber.variation.load_metadata.class%">
<tag name="doctrine.event_subscriber" />
<argument>%sylius.variation.variables%</argument>
</service>
<service id="sylius.validator.variant.unique" class="%sylius.validator.variant.unique.class%">
<argument type="service" id="sylius.repository.variant" />
<tag name="validator.constraint_validator" alias="sylius.validator.variant.unique" />
</service>
<service id="sylius.validator.variant.combination" class="%sylius.validator.variant.combination.class%">
<tag name="validator.constraint_validator" alias="sylius.validator.variant.combination" />
</service>
<service id="sylius.generator.variant" class="%sylius.generator.variant.class%">
<argument type="service" id="sylius.factory.product_variant" />
<argument type="service" id="sylius.set_builder.cartesian" />
</service>
<service id="sylius.variant_resolver.default" class="%sylius.variant_resolver.default.class%">
<tag name="sylius.variant_resolver.default" type="default" />
</service>
</services> </services>
</container> </container>

View file

@ -57,4 +57,83 @@
</property> </property>
</class> </class>
<class name="Sylius\Component\Product\Model\Variant">
<property name="code">
<constraint name="NotBlank">
<option name="message">sylius.option.code.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
<constraint name="Sylius\Bundle\ProductBundle\Validator\Constraint\VariantCombination">
<option name="groups">sylius</option>
</constraint>
</class>
<class name="Sylius\Component\Product\Model\Option">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">code</option>
<option name="message">sylius.option.code.unique</option>
<option name="groups">sylius</option>
</constraint>
<property name="code">
<constraint name="NotBlank">
<option name="message">sylius.option.code.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="values">
<constraint name="Valid" />
<constraint name="Count">
<option name="min">2</option>
<option name="minMessage">sylius.option.values.min_count</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="translations">
<constraint name="Valid" />
</property>
</class>
<class name="Sylius\Component\Product\Model\OptionTranslation">
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.option.name.not_blank</option>
<option name="groups">sylius</option>
</constraint>
<constraint name="Length">
<option name="min">2</option>
<option name="minMessage">sylius.option.name.min_length</option>
<option name="max">255</option>
<option name="maxMessage">sylius.option.name.max_length</option>
<option name="groups">sylius</option>
</constraint>
</property>
</class>
<class name="Sylius\Component\Product\Model\OptionValue">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">code</option>
<option name="message">sylius.option_value.code.unique</option>
<option name="groups">sylius</option>
</constraint>
<property name="code">
<constraint name="NotBlank">
<option name="message">sylius.option_value.code.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="translations">
<constraint name="Valid" />
</property>
</class>
<class name="Sylius\Component\Product\Model\OptionValueTranslation">
<property name="value">
<constraint name="NotBlank">
<option name="message">sylius.option_value.value.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
</class>
</constraint-mapping> </constraint-mapping>

View file

@ -16,3 +16,11 @@ sylius:
association: association:
type: Association Type type: Association Type
product: Associated Product product: Associated Product
variant:
name: Name
option:
name: Name
values: Possible values
option_value:
add_value: Add value
value: Value

View file

@ -14,3 +14,20 @@ sylius:
sku: sku:
not_blank: Please enter variant SKU. not_blank: Please enter variant SKU.
unique: Variant SKU must be unique. 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.

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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; use Symfony\Component\Validator\Constraint;

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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; use Symfony\Component\Validator\Constraint;

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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\ProductInterface;
use Sylius\Component\Product\Model\VariantInterface; use Sylius\Component\Product\Model\VariantInterface;

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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\Resource\Repository\RepositoryInterface;
use Sylius\Component\Product\Model\VariantInterface; use Sylius\Component\Product\Model\VariantInterface;

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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\Common\EventSubscriber;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs; use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
@ -48,7 +48,7 @@ final class LoadMetadataSubscriberSpec extends ObjectBehavior
function it_is_initializable() 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() function it_is_a_Doctrine_event_subscriber()

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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 Doctrine\Common\Collections\Collection;
use PhpSpec\ObjectBehavior; use PhpSpec\ObjectBehavior;
@ -28,7 +28,7 @@ final class VariantToCombinationTransformerSpec extends ObjectBehavior
function it_is_initializable() 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() function it_is_a_form_data_transformer()

View file

@ -9,9 +9,10 @@
* file that was distributed with this source code. * 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 PhpSpec\ObjectBehavior;
use Sylius\Bundle\ProductBundle\Form\EventListener\BuildVariantFormSubscriber;
use Sylius\Component\Product\Model\OptionInterface; use Sylius\Component\Product\Model\OptionInterface;
use Sylius\Component\Product\Model\OptionValueInterface; use Sylius\Component\Product\Model\OptionValueInterface;
use Sylius\Component\Product\Model\ProductInterface; use Sylius\Component\Product\Model\ProductInterface;
@ -21,27 +22,30 @@ use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
/**
* @mixin BuildVariantFormSubscriber
*/
final class BuildVariantFormSubscriberSpec extends ObjectBehavior final class BuildVariantFormSubscriberSpec extends ObjectBehavior
{ {
function let(FormFactoryInterface $factory) function let(FormFactoryInterface $factory)
{ {
$this->beConstructedWith('variable_name', $factory); $this->beConstructedWith($factory);
} }
function it_is_initializable() function it_is_initializable()
{ {
$this->shouldHaveType('Sylius\Bundle\VariationBundle\Form\EventListener\BuildVariantFormSubscriber'); $this->shouldHaveType(BuildVariantFormSubscriber::class);
} }
function it_subscribes_to_event() function it_subscribes_to_event()
{ {
$this::getSubscribedEvents()->shouldReturn( static::getSubscribedEvents()->shouldReturn(
[FormEvents::PRE_SET_DATA => 'preSetData'] [FormEvents::PRE_SET_DATA => 'preSetData']
); );
} }
function it_adds_options_on_pre_set_data_event( function it_adds_options_on_pre_set_data_event(
$factory, FormFactoryInterface $factory,
FormEvent $event, FormEvent $event,
FormInterface $form, FormInterface $form,
FormInterface $optionsForm, FormInterface $optionsForm,
@ -60,7 +64,7 @@ final class BuildVariantFormSubscriberSpec extends ObjectBehavior
$factory->createNamed( $factory->createNamed(
'options', 'options',
'sylius_variable_name_option_value_collection', 'sylius_product_option_value_collection',
[$optionValue], [$optionValue],
[ [
'options' => [$options], 'options' => [$options],

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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 PhpSpec\ObjectBehavior;
use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraint;
@ -21,7 +21,7 @@ final class VariantCombinationSpec extends ObjectBehavior
{ {
function it_is_initializable() 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() function it_is_a_validation_constraint()

View file

@ -9,7 +9,7 @@
* file that was distributed with this source code. * 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 PhpSpec\ObjectBehavior;
use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraint;
@ -26,7 +26,7 @@ final class VariantUniqueSpec extends ObjectBehavior
function it_is_initializable() 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() function it_is_a_validation_constraint()

View file

@ -9,12 +9,12 @@
* file that was distributed with this source code. * 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 Doctrine\Common\Collections\ArrayCollection;
use PhpSpec\ObjectBehavior; use PhpSpec\ObjectBehavior;
use Prophecy\Argument; 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\OptionValueInterface;
use Sylius\Component\Product\Model\ProductInterface; use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Product\Model\VariantInterface; use Sylius\Component\Product\Model\VariantInterface;
@ -30,7 +30,7 @@ final class VariantCombinationValidatorSpec extends ObjectBehavior
function it_is_initializable() function it_is_initializable()
{ {
$this->shouldHaveType('Sylius\Bundle\VariationBundle\Validator\VariantCombinationValidator'); $this->shouldHaveType('Sylius\Bundle\ProductBundle\Validator\VariantCombinationValidator');
} }
function it_is_a_constraint_validator() function it_is_a_constraint_validator()

View file

@ -9,11 +9,11 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace spec\Sylius\Bundle\VariationBundle\Validator; namespace spec\Sylius\Bundle\ProductBundle\Validator;
use PhpSpec\ObjectBehavior; use PhpSpec\ObjectBehavior;
use Prophecy\Argument; 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\Resource\Repository\RepositoryInterface;
use Sylius\Component\Product\Model\VariantInterface; use Sylius\Component\Product\Model\VariantInterface;
use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\ConstraintValidator;
@ -34,7 +34,7 @@ final class VariantUniqueValidatorSpec extends ObjectBehavior
function it_is_initializable() function it_is_initializable()
{ {
$this->shouldHaveType('Sylius\Bundle\VariationBundle\Validator\VariantUniqueValidator'); $this->shouldHaveType('Sylius\Bundle\ProductBundle\Validator\VariantUniqueValidator');
} }
function it_is_a_constraint_validator() function it_is_a_constraint_validator()

View file

@ -1,5 +0,0 @@
vendor/
bin/
composer.phar
composer.lock

View file

@ -1,6 +0,0 @@
CHANGELOG
=========
### v0.10.0
* Initial dev release.

View file

@ -1,252 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\VariationBundle\DependencyInjection;
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\VariationBundle\Form\Type\OptionTranslationType;
use Sylius\Bundle\VariationBundle\Form\Type\OptionType;
use Sylius\Bundle\VariationBundle\Form\Type\OptionValueTranslationType;
use Sylius\Bundle\VariationBundle\Form\Type\OptionValueType;
use Sylius\Bundle\VariationBundle\Form\Type\VariantType;
use Sylius\Component\Product\Model\OptionValueTranslation;
use Sylius\Component\Product\Model\OptionValueTranslationInterface;
use Sylius\Component\Resource\Factory\Factory;
use Sylius\Component\Resource\Factory\TranslatableFactory;
use Sylius\Component\Product\Model\OptionTranslation;
use Sylius\Component\Product\Model\OptionTranslationInterface;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This class contains the configuration information for the bundle.
*
* This information is solely responsible for how the different configuration
* sections are normalized, and merged.
*
* @author Paweł Jędrzejewski <pawel@sylius.org>
*/
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()
;
}
}

View file

@ -1,144 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\VariationBundle\DependencyInjection;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension;
use Sylius\Bundle\VariationBundle\Form\Type\OptionValueChoiceType;
use Sylius\Bundle\VariationBundle\Form\Type\OptionValueCollectionType;
use Sylius\Bundle\VariationBundle\Form\Type\VariantChoiceType;
use Sylius\Bundle\VariationBundle\Form\Type\VariantMatchType;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
/**
* Archetype extension.
*
* @author Paweł Jędrzejewski <pawel@sylius.org>
*/
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);
}
}

View file

@ -1,29 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\VariationBundle\Form\ChoiceList;
use Sylius\Component\Product\Model\ProductInterface;
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
/**
* @author Paweł Jędrzejewski <pawel@sylius.org>
*/
class VariantChoiceList extends ObjectChoiceList
{
/**
* @param ProductInterface $variable
*/
public function __construct(ProductInterface $variable)
{
parent::__construct($variable->getVariants(), 'name', [], null, 'id');
}
}

View file

@ -1,65 +0,0 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\VariationBundle\Form\Type;
use Sylius\Bundle\ResourceBundle\Form\EventSubscriber\AddCodeFormSubscriber;
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
use Sylius\Bundle\VariationBundle\Form\EventListener\BuildVariantFormSubscriber;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* @author Paweł Jędrzejewski <pawel@sylius.org>
*/
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);
}
}

View file

@ -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).

View file

@ -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"

View file

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
<mapped-superclass name="Sylius\Component\Product\Model\Option" table="sylius_option">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="code" column="code" type="string" unique="true" />
<field name="createdAt" column="created_at" type="datetime">
<gedmo:timestampable on="create"/>
</field>
<field name="updatedAt" column="updated_at" type="datetime" nullable="true">
<gedmo:timestampable on="update"/>
</field>
</mapped-superclass>
</doctrine-mapping>

View file

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<mapped-superclass name="Sylius\Component\Product\Model\OptionTranslation" table="sylius_option_translation">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="name" column="name" type="string" />
</mapped-superclass>
</doctrine-mapping>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
>
<mapped-superclass name="Sylius\Component\Product\Model\OptionValue" table="sylius_option_value">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="code" column="code" type="string" unique="true" />
</mapped-superclass>
</doctrine-mapping>

View file

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<mapped-superclass name="Sylius\Component\Product\Model\OptionValueTranslation"
table="sylius_option_value_translation">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="value" column="value" type="string" />
</mapped-superclass>
</doctrine-mapping>

View file

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
>
<mapped-superclass name="Sylius\Component\Product\Model\Variant" table="sylius_variant">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<field name="code" column="code" type="string" unique="true" nullable="false"/>
<field name="name" column="name" type="string" nullable="true" />
<field name="createdAt" column="created_at" type="datetime">
<gedmo:timestampable on="create"/>
</field>
<field name="updatedAt" column="updated_at" type="datetime" nullable="true">
<gedmo:timestampable on="update"/>
</field>
</mapped-superclass>
</doctrine-mapping>

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="sylius.event_subscriber.variation.load_metadata.class">Sylius\Bundle\VariationBundle\EventListener\LoadMetadataSubscriber</parameter>
<parameter key="sylius.validator.variant.unique.class">Sylius\Bundle\VariationBundle\Validator\VariantUniqueValidator</parameter>
<parameter key="sylius.validator.variant.combination.class">Sylius\Bundle\VariationBundle\Validator\VariantCombinationValidator</parameter>
<parameter key="sylius.generator.variant.class">Sylius\Component\Product\Generator\VariantGenerator</parameter>
<parameter key="sylius.variant_resolver.default.class">Sylius\Component\Product\Resolver\DefaultVariantResolver</parameter>
</parameters>
<services>
<service id="sylius.event_subscriber.variation.load_metadata" class="%sylius.event_subscriber.variation.load_metadata.class%">
<tag name="doctrine.event_subscriber" />
<argument>%sylius.variation.variables%</argument>
</service>
<service id="sylius.validator.variant.unique" class="%sylius.validator.variant.unique.class%">
<argument type="service" id="sylius.repository.variant" />
<tag name="validator.constraint_validator" alias="sylius.validator.variant.unique" />
</service>
<service id="sylius.validator.variant.combination" class="%sylius.validator.variant.combination.class%">
<tag name="validator.constraint_validator" alias="sylius.validator.variant.combination" />
</service>
<service id="sylius.generator.variant" class="%sylius.generator.variant.class%">
<argument type="service" id="sylius.factory.product_variant" />
<argument type="service" id="sylius.set_builder.cartesian" />
</service>
<service id="sylius.variant_resolver.default" class="%sylius.variant_resolver.default.class%">
<tag name="sylius.variant_resolver.default" type="default" />
</service>
</services>
</container>

View file

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping
http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Product\Model\Variant">
<property name="code">
<constraint name="NotBlank">
<option name="message">sylius.option.code.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
<constraint name="Sylius\Bundle\VariationBundle\Validator\Constraint\VariantCombination">
<option name="groups">sylius</option>
</constraint>
</class>
<class name="Sylius\Component\Product\Model\Option">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">code</option>
<option name="message">sylius.option.code.unique</option>
<option name="groups">sylius</option>
</constraint>
<property name="code">
<constraint name="NotBlank">
<option name="message">sylius.option.code.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="values">
<constraint name="Valid" />
<constraint name="Count">
<option name="min">2</option>
<option name="minMessage">sylius.option.values.min_count</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="translations">
<constraint name="Valid" />
</property>
</class>
<class name="Sylius\Component\Product\Model\OptionTranslation">
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.option.name.not_blank</option>
<option name="groups">sylius</option>
</constraint>
<constraint name="Length">
<option name="min">2</option>
<option name="minMessage">sylius.option.name.min_length</option>
<option name="max">255</option>
<option name="maxMessage">sylius.option.name.max_length</option>
<option name="groups">sylius</option>
</constraint>
</property>
</class>
<class name="Sylius\Component\Product\Model\OptionValue">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
<option name="fields">code</option>
<option name="message">sylius.option_value.code.unique</option>
<option name="groups">sylius</option>
</constraint>
<property name="code">
<constraint name="NotBlank">
<option name="message">sylius.option_value.code.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="translations">
<constraint name="Valid" />
</property>
</class>
<class name="Sylius\Component\Product\Model\OptionValueTranslation">
<property name="value">
<constraint name="NotBlank">
<option name="message">sylius.option_value.value.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
</class>
</constraint-mapping>

View file

@ -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.

View file

@ -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: القيمة

View file

@ -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: Значэнне

View file

@ -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: Стойност

View file

@ -1,9 +0,0 @@
# This file is part of the Sylius package.
# (c) Paweł Jędrzejewski
sylius:
form:
variant:
name: Nom
option:
name: Nom

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,9 +0,0 @@
# This file is part of the Sylius package.
# (c) Paweł Jędrzejewski
sylius:
form:
variant:
name: Name
option:
name: Name

View file

@ -1,9 +0,0 @@
# This file is part of the Sylius package.
# (c) Paweł Jędrzejewski
sylius:
form:
variant:
name: Ονομασία
option:
name: Ονομασία

View file

@ -1,10 +0,0 @@
sylius:
form:
variant:
name: Name
option:
name: Name
values: Possible values
option_value:
add_value: Add value
value: Value

View file

@ -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

View file

@ -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: مقدار

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,9 +0,0 @@
# This file is part of the Sylius package.
# (c) Paweł Jędrzejewski
sylius:
form:
variant:
name: Nama
option:
name: Nama

View file

@ -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

View file

@ -1,7 +0,0 @@
# This file is part of the Sylius package.
# (c) Paweł Jędrzejewski
sylius:
form:
option:
values: 예상값

View file

@ -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ė

View file

@ -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: Вредност

View file

@ -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

View file

@ -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

View file

@ -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ść

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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: Значение

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,9 +0,0 @@
# This file is part of the Sylius package.
# (c) Paweł Jędrzejewski
sylius:
form:
variant:
name: Ime
option:
name: Ime

View file

@ -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

View file

@ -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: ค่า

View file

@ -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

View file

@ -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: Значення

Some files were not shown because too many files have changed in this diff Show more