<?php

namespace Lc\ShopBundle\Form\Backend\Order;

use Doctrine\ORM\EntityManagerInterface;
use Lc\ShopBundle\Context\MerchantUtilsInterface;
use Lc\ShopBundle\Context\OrderShopInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class OrderProductsActionType extends AbstractType
{
        protected $em;
        protected $merchantUtils;

        public function __construct(EntityManagerInterface $em, MerchantUtilsInterface $merchantUtils)
        {
                $this->em = $em;
                $this->merchantUtils = $merchantUtils;
        }

        public function buildForm(FormBuilderInterface $builder, array $options)
        {

                $builder->add('orderProducts', CollectionType::class, array(
                                'label' => false,
                                'mapped'=>false,
                                'entry_type' => CheckboxType::class,
                                'entry_options' => ['label' => false],
                                'allow_add' => true,
                                'allow_delete' => true
                        )
                );
        }

        public function configureOptions(OptionsResolver $resolver)
        {
                $resolver->setDefaults([
                ]);
        }
}
