<?php
namespace App\Factory\Ecommerce;
use App\Entity\Ecommerce\Gift;
use Symfony\Component\Form\FormInterface;
/**
* @author Juanjo MartÃnez <jmartinez@wearemarketing.com>
* @author David Velasco <dvelasco@wearemarketing.com>
*/
class GiftFormFactory extends AbstractGiftFormFactory
{
public function createForm(Gift $object, array $options = array()): FormInterface
{
$options = array_merge(['gift' => $object], $options);
$form = $this->getForm($options);
[$choices, $defaultValues] = $this->extractChoices($object);
$this->addFields($choices, $defaultValues, $form);
return $form;
}
}