/** * * @param OnlineTaxe $taxe * Constructor */ public function __construct(OnlineTaxe $taxe = null) { if (null != $taxe) { $this->label = $taxe->getLabel(); $this->type = $taxe->getType(); $this->priority = $taxe->getPriority(); $this->value = $taxe->getValue(); } else { $this->value = 0; $this->type = self::TYPE_NUMERIC; $this->priority = 1; } $this->dtCrea = new \DateTime('now'); }
/** * Form builder * * @param FormBuilderInterface $builder * @param array $options * * @return null */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('label', TextType::class, array('label' => 'Taxe.label.label')); $builder->add('value', NumberType::class, array('label' => 'Taxe.value.label')); $builder->add('type', ChoiceType::class, array('label' => 'Taxe.type.label', 'choices_as_values' => true, 'choices' => OnlineTaxe::choiceType(), 'attr' => array('choice_label_trans' => true))); $builder->add('visible', ChoiceType::class, array('label' => 'Taxe.visible.label', 'choices_as_values' => true, 'choices' => OnlineTaxe::choiceVisible(), 'attr' => array('choice_label_trans' => true))); $builder->add('priority', NumberType::class, array('label' => 'Taxe.priority.label')); }
/** * Form builder * * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('type', ChoiceType::class, array('label' => 'Taxe.type.label', 'choices_as_values' => true, 'choices' => OnlineTaxe::choiceType(), 'attr' => array('choice_label_trans' => true))); }