src/Factory/Ecommerce/GiftFormFactory.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Factory\Ecommerce;
  3. use App\Entity\Ecommerce\Gift;
  4. use Symfony\Component\Form\FormInterface;
  5. /**
  6.  * @author Juanjo Martínez <jmartinez@wearemarketing.com>
  7.  * @author David Velasco <dvelasco@wearemarketing.com>
  8.  */
  9. class GiftFormFactory extends AbstractGiftFormFactory
  10. {
  11.     public function createForm(Gift $object, array $options = array()): FormInterface
  12.     {
  13.         $options array_merge(['gift' => $object], $options);
  14.         $form $this->getForm($options);
  15.         [$choices$defaultValues] = $this->extractChoices($object);
  16.         $this->addFields($choices$defaultValues$form);
  17.         return $form;
  18.     }
  19. }