Author: Adam Piotrowski (adam@wellcommerce.org)
Inheritance: extends WellCommerce\Bundle\DoctrineBundle\Repository\RepositoryInterface
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('select', ['name' => 'code', 'label' => $this->trans('currency.label.code'), 'options' => $this->repository->getCurrenciesToSelect()]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $form = $builder->init($options);
     $requiredData = $form->addChild($builder->getElement('fieldset', ['name' => 'required_data', 'label' => $this->trans('form.required_data')]));
     $requiredData->addChild($builder->getElement('select', ['name' => 'code', 'label' => $this->trans('currency.code'), 'options' => $this->repository->getCurrenciesToSelect()]));
     $form->addFilter('no_code');
     $form->addFilter('trim');
     $form->addFilter('secure');
     return $form;
 }
 /**
  * Returns all currencies from repository
  *
  * @return \WellCommerce\Bundle\CurrencyBundle\Entity\Currency[]
  */
 protected function getCurrencies()
 {
     return $this->currencyRepository->findAll();
 }