ChillPersonBundle: move numberOfDependents configuration to a new household node; extend AdministrativeStatusRepository and EmploymentStatusRepository from ServiceEntityRepository

This commit is contained in:
Christophe Siraut
2024-12-20 11:28:36 +01:00
parent fbdc0d32f0
commit 03717a1a87
12 changed files with 49 additions and 128 deletions

View File

@@ -23,14 +23,14 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
class HouseholdCompositionType extends AbstractType
{
private array $fields_visibility;
private array $household_fields_visibility;
public function __construct(
private readonly HouseholdCompositionTypeRepository $householdCompositionTypeRepository,
private readonly TranslatableStringHelperInterface $translatableStringHelper,
protected ParameterBagInterface $parameterBag,
) {
$this->fields_visibility = $parameterBag->get('chill_person.person_fields');
$this->household_fields_visibility = $parameterBag->get('chill_person.household_fields');
}
public function buildForm(FormBuilderInterface $builder, array $options)
@@ -52,7 +52,7 @@ class HouseholdCompositionType extends AbstractType
'required' => true,
'label' => 'household_composition.numberOfChildren',
]);
if ('visible' == $this->fields_visibility['number_of_dependents']) {
if ('visible' == $this->household_fields_visibility['number_of_dependents']) {
$builder
->add('numberOfDependents', IntegerType::class, [
'required' => true,