<?php
/**
* Created by PhpStorm.
* User: parcel
* Date: 10/17/18
* Time: 9:44 AM
*/
namespace App\Form;
use App\Entity\Transaction;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class TransactionForm extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options){
$builder
->add('amount', IntegerType::class)
->add('pinNumber', TextType::class);
}
public function configureOptions(OptionsResolver $resolver) {
$resolver
->setDefaults([
'data_class' => Transaction::class
]);
}
public function getBlockPrefix()
{
return 'app_bundle_transaction_form';
}
}