for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?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.
*/
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\Form\Type\Promotion\Action;
use Sylius\Bundle\CoreBundle\Form\Type\ChannelCollectionType;
use Sylius\Bundle\PromotionBundle\Form\Type\Action\UnitFixedDiscountConfigurationType;
use Sylius\Component\Core\Model\ChannelInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* @author Kamil Kokot <[email protected]>
final class ChannelBasedUnitFixedDiscountConfigurationType extends AbstractType
{
* {@inheritdoc}
public function configureOptions(OptionsResolver $resolver): void
$resolver->setDefaults([
'entry_type' => UnitFixedDiscountConfigurationType::class,
'entry_options' => function (ChannelInterface $channel) {
return [
'label' => $channel->getName(),
'currency' => $channel->getBaseCurrency()->getCode(),
];
},
]);
}
public function getParent(): string
return ChannelCollectionType::class;