wip: backport form handing system from create flow to edit flow
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Form\Service\Condition;
|
||||
|
||||
use App\Form\Model\BookingDtoInterface;
|
||||
use App\Form\Service\Contract\FieldConditionInterface;
|
||||
|
||||
/**
|
||||
* Condition that checks if additional services are mutable in the edit flow.
|
||||
*/
|
||||
class AdditionalServicesMutabilityCondition implements FieldConditionInterface
|
||||
{
|
||||
public function evaluate(BookingDtoInterface $bookingDto, int $participantIndex, array $formData): bool
|
||||
{
|
||||
return false === $bookingDto->travel->additionalServicesMutable;
|
||||
}
|
||||
|
||||
public function getDependentFields(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Additional services are not mutable (edit flow)';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user