wip: dynamic services fields
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Form\Service\Abstract\AbstractFieldStateProvider;
|
||||
use App\Form\Service\Condition\CompositeCondition;
|
||||
use App\Form\Service\Condition\DateOfBirthProvidedCondition;
|
||||
use App\Form\Service\Condition\RentalSelectionCondition;
|
||||
use App\Form\Service\Condition\RoomSelectionCondition;
|
||||
|
||||
/**
|
||||
* Field state provider for the booking create workflow.
|
||||
@@ -83,6 +84,14 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
'hidden' => CompositeCondition::not($dateOfBirthProvidedCondition),
|
||||
];
|
||||
|
||||
// Room-specific field conditions
|
||||
$mbzRoomCondition = new RoomSelectionCondition(['mbz']);
|
||||
|
||||
// Show remarks room field only when room with code 'mbz' is selected
|
||||
$this->fieldStateConditions['remarksRoom'] = [
|
||||
'hidden' => CompositeCondition::not($mbzRoomCondition),
|
||||
];
|
||||
|
||||
// Example field state conditions would be registered here
|
||||
// For demonstration purposes, here are some example patterns:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user