Commit 7e2c6c35 by Yvon

5893 add household composition to household section

parent cb3312a3
......@@ -185,6 +185,18 @@ class AdherentAdmin extends AbstractAdmin
$formMapper
->tab('General')
->with('Foyer', ['class' => 'col-md-7'])
->add('householdComposition',ChoiceType::class, [
'choices' => [
"Personne seule" => "Personne seule",
"Couple sans enfant à charge" => "Couple sans enfant à charge",
"Famille mono-parentale" => "Famille mono-parentale",
"Couple avec enfant(s) à charge" => "Couple avec enfant(s) à charge",
"Autre" => "Autre"
],
'label' => "Composition du foyer (pour information)",
'required' => true,
'placeholder' => "Choix de la composition du foyer",
])
->add('dependentChildren', CollectionType::class, [
'entry_type' => DependentChildFormType::class,
'entry_options' => [
......
......@@ -119,6 +119,11 @@ class Adherent extends AccountableObject implements AccountableInterface
*/
private $dependentChildren;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $householdComposition;
public function __construct()
{
......@@ -307,6 +312,18 @@ class Adherent extends AccountableObject implements AccountableInterface
return $this;
}
public function getHouseholdComposition(): ?string
{
return $this->householdComposition;
}
public function setHouseholdComposition(?string $householdComposition): self
{
$this->householdComposition = $householdComposition;
return $this;
}
public function getJourPrelevement(): ?int
{
......
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240311163934 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE adherent ADD household_composition VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE adherent DROP household_composition');
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\'');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment