diff --git a/src/Form/MemberCaseFormType.php b/src/Form/MemberCaseFormType.php index ac4d765..7f08ccb 100644 --- a/src/Form/MemberCaseFormType.php +++ b/src/Form/MemberCaseFormType.php @@ -2,14 +2,13 @@ namespace App\Form; -use App\Entity\CompanyDocument; use App\Entity\MemberCase; use App\Entity\ReferralSource; use App\Enums\CaseLevel; use App\Enums\County; +use App\Enums\Case\ReferralType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\EnumType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; @@ -19,6 +18,8 @@ class MemberCaseFormType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { + $docs = $options['docs']; + $builder ->add('caseNumber', TextType::class, [ 'required' => true @@ -29,7 +30,9 @@ class MemberCaseFormType extends AbstractType ->add('lastName', TextType::class, [ 'required' => true ]) - ->add('referralType') + ->add('referralType', EnumType::class, [ + 'class' => ReferralType::class + ]) ->add('admitDate', null, [ 'widget' => 'single_text', 'required' => true, @@ -62,11 +65,6 @@ class MemberCaseFormType extends AbstractType ->add('county', EnumType::class, [ 'class' => County::class, ]) - ->add('docs', ChoiceType::class, [ - 'data_class' => CompanyDocument::class, - 'multiple' => true, - 'expanded' => true, - ]) ; }