<?php
declare(strict_types=1);
namespace Juki\Bundle\AppBundle\EventListener;
use Hitso\Bundle\FormBundle\Event\FormEvent;
use Hitso\Bundle\MultiSiteBundle\MultiSite\SiteCollection;
use Hitso\Bundle\MultiSiteBundle\MultiSite\SiteContext;
use Juki\Bundle\AppBundle\Entity\Dictionary\Shop;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
/**
* Class AttributeSubscriber
*
* @package Juki\Bundle\AppBundle\EventListener
*/
final class AttributeSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
'attribute_type.form_init' => 'onFormInit',
];
}
public function onFormInit(FormEvent $event)
{
$builder = $event->getBuilder();
$builder->add(
'scope',
CheckboxType::class,
[
'label' => 'WyĆwietlaj jako zakres',
'required' => false,
'position' => ['after' => 'position'],
]
);
}
}