30 lines
716 B
PHP
30 lines
716 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Form\Service\Condition;
|
|
|
|
use App\Form\Model\BookingDto;
|
|
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(BookingDto $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)';
|
|
}
|
|
}
|