예제 #1
0
 /**
  * @param \Spryker\Zed\Tax\Communication\Form\DataProvider\TaxRateFormDataProvider $taxRateFormDataProvider
  *
  * @return \Symfony\Component\Form\FormInterface
  */
 public function createTaxRateForm(TaxRateFormDataProvider $taxRateFormDataProvider)
 {
     $taxRateForm = new TaxRateForm($taxRateFormDataProvider, $this->createPercentageTransformer());
     return $this->getFormFactory()->create($taxRateForm, $taxRateFormDataProvider->getData(), ['data_class' => TaxRateTransfer::class]);
 }
예제 #2
0
파일: TaxRateForm.php 프로젝트: spryker/Tax
 /**
  * @param \Symfony\Component\Form\FormBuilderInterface $builder
  *
  * @return $this
  */
 protected function addCountry(FormBuilderInterface $builder)
 {
     $builder->add(self::FIELD_COUNTRY, 'choice', ['expanded' => false, 'multiple' => false, 'label' => 'Country*', 'choices' => $this->taxRateFormDataProvider->getOptions()[self::FIELD_COUNTRY], 'constraints' => [new GreaterThan(['value' => 0, 'message' => 'Select country.'])], 'attr' => []]);
     return $this;
 }