src/Form/ApplicantType.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Applicant;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Symfony\Component\OptionsResolver\OptionsResolver;
  7. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  8. use Symfony\Component\Form\Extension\Core\Type\FileType;
  9. use Symfony\Component\Form\Extension\Core\Type\TextType;
  10. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  11. use Symfony\Component\Validator\Constraints\File;
  12. class ApplicantType extends AbstractType
  13. {
  14.     public function buildForm(FormBuilderInterface $builder, array $options): void
  15.     {
  16.         $builder
  17.          ->add('Division'ChoiceType::class, [
  18.             'choices' => [
  19.                 'Body Imaging'=> 'Body'
  20.                'Musculoskeletal Imaging' => 'MSK',  
  21.                 'Breast Imaging' => 'Breast',   
  22.                 'Magnetic Resonance Imaging' => 'MRI',
  23.                 'Women Imaging' => 'Women',
  24.         'PET/CT & Theranostics' => 'PET',
  25.                 'Cardiothoracic Imaging' => 'Chest',
  26.             ],
  27.             ])
  28.             ->add('Name')
  29.             ->add('Email')
  30.             ->add('Address')
  31.             ->add('Degree')
  32.             ->add('CurrentPosition')
  33.             ->add('Phone')
  34.            
  35.             ->add('appForm'FileType::class, [
  36.                 'label' => 'Application Form (PDF file)',
  37.                 // unmapped means that this field is not associated to any entity property
  38.                 'mapped' => false,
  39.                 // make it optional so you don't have to re-upload the PDF file
  40.                 // every time you edit the Product details
  41.                 'required' => false,
  42.                 // unmapped fields can't define their validation using annotations
  43.                 // in the associated entity, so you can use the PHP constraint classes
  44.                 'constraints' => [
  45.                     new File([
  46.                         'maxSize' => '6072k',
  47.                         'mimeTypes' => [
  48.                             'application/pdf',
  49.                             'application/x-pdf',
  50.                         ],
  51.                         'mimeTypesMessage' => 'Please upload a valid PDF document',
  52.                     ])
  53.                 ],
  54.             ])
  55.             ->add('PersonalStat'FileType::class, [
  56.                 'label' => 'Personal Statment (PDF file)',
  57.                 // unmapped means that this field is not associated to any entity property
  58.                 'mapped' => false,
  59.                 // make it optional so you don't have to re-upload the PDF file
  60.                 // every time you edit the Product details
  61.                 'required' => false,
  62.                 // unmapped fields can't define their validation using annotations
  63.                 // in the associated entity, so you can use the PHP constraint classes
  64.                 'constraints' => [
  65.                     new File([
  66.                         'maxSize' => '6072k',
  67.                         'mimeTypes' => [
  68.                             'application/pdf',
  69.                             'application/x-pdf',
  70.                         ],
  71.                         'mimeTypesMessage' => 'Please upload a valid PDF document',
  72.                     ])
  73.                 ],
  74.             ])
  75.             ->add('CVLink'FileType::class, [
  76.                 'label' => 'CV (PDF file)',
  77.                 // unmapped means that this field is not associated to any entity property
  78.                 'mapped' => false,
  79.                 // make it optional so you don't have to re-upload the PDF file
  80.                 // every time you edit the Product details
  81.                 'required' => false,
  82.                 // unmapped fields can't define their validation using annotations
  83.                 // in the associated entity, so you can use the PHP constraint classes
  84.                 'constraints' => [
  85.                     new File([
  86.                         'maxSize' => '6072k',
  87.                         'mimeTypes' => [
  88.                             'application/pdf',
  89.                             'application/x-pdf',
  90.                         ],
  91.                         'mimeTypesMessage' => 'Please upload a valid PDF document',
  92.                     ])
  93.                 ],
  94.             ])
  95.             ->add('usfile'FileType::class, [
  96.                 'label' => 'USMLE (PDF file)',
  97.                 // unmapped means that this field is not associated to any entity property
  98.                 'mapped' => false,
  99.                 // make it optional so you don't have to re-upload the PDF file
  100.                 // every time you edit the Product details
  101.                 'required' => false,
  102.                 // unmapped fields can't define their validation using annotations
  103.                 // in the associated entity, so you can use the PHP constraint classes
  104.                 'constraints' => [
  105.                     new File([
  106.                         'maxSize' => '6072k',
  107.                         'mimeTypes' => [
  108.                             'application/pdf',
  109.                             'application/x-pdf',
  110.                         ],
  111.                         'mimeTypesMessage' => 'Please upload a valid PDF document',
  112.                     ])
  113.                 ],
  114.             ])
  115.             ->add('dlFile'FileType::class, [
  116.                 'label' => 'Dean Letter (PDF file), *See Note Below',
  117.                 // unmapped means that this field is not associated to any entity property
  118.                 'mapped' => false,
  119.                 // make it optional so you don't have to re-upload the PDF file
  120.                 // every time you edit the Product details
  121.                 'required' => false,
  122.                 // unmapped fields can't define their validation using annotations
  123.                 // in the associated entity, so you can use the PHP constraint classes
  124.                 'constraints' => [
  125.                     new File([
  126.                         'maxSize' => '7072k',
  127.                         'mimeTypes' => [
  128.                             'application/pdf',
  129.                             'application/x-pdf',
  130.                         ],
  131.                         'mimeTypesMessage' => 'Please upload a valid PDF document',
  132.                     ])
  133.                 ],
  134.             ])
  135.             ->add('mdFile'FileType::class, [
  136.                 'label' => 'Medical School Diploma (PDF file)',
  137.                 // unmapped means that this field is not associated to any entity property
  138.                 'mapped' => false,
  139.                 // make it optional so you don't have to re-upload the PDF file
  140.                 // every time you edit the Product details
  141.                 'required' => false,
  142.                 // unmapped fields can't define their validation using annotations
  143.                 // in the associated entity, so you can use the PHP constraint classes
  144.                 'constraints' => [
  145.                     new File([
  146.                         'maxSize' => '6072k',
  147.                         'mimeTypes' => [
  148.                             'application/pdf',
  149.                             'application/x-pdf',
  150.                         ],
  151.                         'mimeTypesMessage' => 'Please upload a valid PDF document',
  152.                     ])
  153.                 ],
  154.             ])
  155.             ->add('Ref1Name',TextType::class, ['label'=>'Reference #1 Name' ])
  156.             ->add('Ref1Email',TextType::class, ['label'=>'Reference #1 Email' ])
  157.             ->add('Ref1Letter',TextType::class, ['label'=>'Reference #1 Job Title' ])
  158.             ->add('Ref2Name',TextType::class, ['label'=>'Reference #2 Name' ])
  159.             ->add('Ref2Email',TextType::class, ['label'=>'Reference #2 Email' ])
  160.             ->add('Ref2Letter',TextType::class, ['label'=>'Reference #2 Job Title' ])
  161.             ->add('Ref3Name',TextType::class, ['label'=>'Reference #3 Name' ])
  162.             ->add('Ref3Email',TextType::class, ['label'=>'Reference #3 Email' ])
  163.             ->add('Ref3Letter',TextType::class, ['label'=>'Reference #3 Job Title' ])
  164.             ->add('Status',ChoiceType::class, ['label'=>'Status for OFFICE Use Only'
  165.             'required' => false,
  166.             'choices' => [
  167.                 'For OFFICE Use Only'=> 'Office'
  168.                 'Withdrew' => 'Withdrew',
  169.                 'Under Consideration'=>'Under Consideration',
  170.                 'Withdrew Before Interview' =>'Withdrew Before Interview',
  171.                 'Interviewed'=>'Interviewed',
  172.                 'Withdrew After Interview'=>'Withdrew After Interview',
  173.                 'Offer Extended'=>'Offer Extended',
  174.                 'Declined Offer'=>'Declined Offer',
  175.                 'Offer Accepted'=>'Offer Accepted',
  176.             ],
  177.             ])
  178.             ->add('Notes',TextareaType::class, ['label'=>'Notes for OFFICE Use Only''required' => false,
  179.             ])
  180.         ;
  181.     }
  182.     public function configureOptions(OptionsResolver $resolver): void
  183.     {
  184.         $resolver->setDefaults([
  185.             'data_class' => Applicant::class,
  186.         ]);
  187.     }
  188. }