wip: modernized edit flow
This commit is contained in:
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Form\Service\Trait;
|
||||
|
||||
use App\Form\Model\BookingDtoInterface;
|
||||
use App\Form\Model\BookingDto;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
|
||||
/**
|
||||
@@ -17,17 +17,17 @@ use Symfony\Component\Form\FormInterface;
|
||||
trait FormTraversalTrait
|
||||
{
|
||||
/**
|
||||
* Gets the BookingDtoInterface from the root of the form tree.
|
||||
* Gets the BookingDto from the root of the form tree.
|
||||
*
|
||||
* This helper method traverses up the form tree to find the root form
|
||||
* and extracts the BookingDtoInterface data. This is shared logic used
|
||||
* and extracts the BookingDto data. This is shared logic used
|
||||
* by both create and edit participant forms.
|
||||
*
|
||||
* @param FormInterface $form The form to start traversing from
|
||||
*
|
||||
* @return BookingDtoInterface|null The booking DTO or null if not found
|
||||
* @return BookingDto|null The booking DTO or null if not found
|
||||
*/
|
||||
public function getBookingDtoFromForm(FormInterface $form): ?BookingDtoInterface
|
||||
public function getBookingDtoFromForm(FormInterface $form): ?BookingDto
|
||||
{
|
||||
// Traverse up the form tree to get the root form's data
|
||||
$rootForm = $form;
|
||||
@@ -37,6 +37,6 @@ trait FormTraversalTrait
|
||||
|
||||
$data = $rootForm->getData();
|
||||
|
||||
return $data instanceof BookingDtoInterface ? $data : null;
|
||||
return $data instanceof BookingDto ? $data : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user