@@ -377,6 +377,8 @@ sport like this::
377
377
// src/Form/Type/SportMeetupType.php
378
378
namespace App\Form\Type;
379
379
380
+ use App\Entity\Sport;
381
+ use App\Entity\Position;
380
382
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
381
383
use Symfony\Component\Form\AbstractType;
382
384
use Symfony\Component\Form\FormBuilderInterface;
@@ -390,7 +392,7 @@ sport like this::
390
392
{
391
393
$builder
392
394
->add('sport', EntityType::class, [
393
- 'class' => 'App\Entity\ Sport' ,
395
+ 'class' => Sport::class ,
394
396
'placeholder' => '',
395
397
])
396
398
;
@@ -407,7 +409,7 @@ sport like this::
407
409
$positions = null === $sport ? [] : $sport->getAvailablePositions();
408
410
409
411
$form->add('position', EntityType::class, [
410
- 'class' => 'App\Entity\ Position' ,
412
+ 'class' => Position::class ,
411
413
'placeholder' => '',
412
414
'choices' => $positions,
413
415
]);
@@ -444,6 +446,7 @@ The type would now look like::
444
446
namespace App\Form\Type;
445
447
446
448
use App\Entity\Sport;
449
+ use App\Entity\Position;
447
450
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
448
451
use Symfony\Component\Form\FormInterface;
449
452
// ...
@@ -454,7 +457,7 @@ The type would now look like::
454
457
{
455
458
$builder
456
459
->add('sport', EntityType::class, [
457
- 'class' => 'App\Entity\ Sport' ,
460
+ 'class' => Sport::class ,
458
461
'placeholder' => '',
459
462
])
460
463
;
@@ -463,7 +466,7 @@ The type would now look like::
463
466
$positions = null === $sport ? [] : $sport->getAvailablePositions();
464
467
465
468
$form->add('position', EntityType::class, [
466
- 'class' => 'App\Entity\ Position' ,
469
+ 'class' => Position::class ,
467
470
'placeholder' => '',
468
471
'choices' => $positions,
469
472
]);
0 commit comments