Files
myep/src/Form/Service/Condition/TransportationServicesMutabilityCondition.php
T

30 lines
750 B
PHP

<?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 transportation services are mutable in the edit flow.
*/
class TransportationServicesMutabilityCondition implements FieldConditionInterface
{
public function evaluate(BookingDtoInterface $bookingDto, int $participantIndex, array $formData): bool
{
return false === $bookingDto->travel->transportationServicesMutable;
}
public function getDependentFields(): array
{
return [];
}
public function getDescription(): string
{
return 'Transportation services are not mutable (edit flow)';
}
}