wip: conditional mandatory body dimensions
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Form\Service;
|
||||
|
||||
use App\Form\Service\Abstract\AbstractFieldStateProvider;
|
||||
use App\Form\Service\Condition\RentalSelectionCondition;
|
||||
|
||||
/**
|
||||
* Field state provider for the booking create workflow.
|
||||
@@ -44,6 +45,21 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
*/
|
||||
protected function registerFieldStateConditions(): void
|
||||
{
|
||||
$rentalCondition = new RentalSelectionCondition();
|
||||
|
||||
// Make body dimension fields required when rental services are selected
|
||||
$this->fieldStateConditions['height'] = [
|
||||
'required' => $rentalCondition,
|
||||
];
|
||||
|
||||
$this->fieldStateConditions['weight'] = [
|
||||
'required' => $rentalCondition,
|
||||
];
|
||||
|
||||
$this->fieldStateConditions['shoeSize'] = [
|
||||
'required' => $rentalCondition,
|
||||
];
|
||||
|
||||
// Example field state conditions would be registered here
|
||||
// For demonstration purposes, here are some example patterns:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user