diff --git a/Controller/PersonController.php b/Controller/PersonController.php index 8e1fc7405..1e27b5cd4 100644 --- a/Controller/PersonController.php +++ b/Controller/PersonController.php @@ -353,7 +353,7 @@ class PersonController extends Controller $em = $this->getDoctrine()->getManager(); $person = $em->getRepository('ChillPersonBundle:Person') - ->find($id); + ->find($id); return $person; } diff --git a/Entity/Person.php b/Entity/Person.php index 2ce0986a1..fa3ede22b 100644 --- a/Entity/Person.php +++ b/Entity/Person.php @@ -24,6 +24,7 @@ namespace Chill\PersonBundle\Entity; use Symfony\Component\Validator\ExecutionContextInterface; use Chill\MainBundle\Entity\Country; +use Chill\PersonBundle\Entity\MaritalStatus; use Doctrine\Common\Collections\ArrayCollection; use Chill\MainBundle\Entity\HasCenterInterface; @@ -402,7 +403,7 @@ class Person implements HasCenterInterface { * @param \Chill\PersonBundle\Entity\MaritalStatus $maritalStatus * @return Person */ - public function setMaritalStatus($maritalStatus) + public function setMaritalStatus(MaritalStatus $maritalStatus = null) { $this->maritalStatus = $maritalStatus; return $this; diff --git a/Form/CreationPersonType.php b/Form/CreationPersonType.php index c64e56b70..dc22aa952 100644 --- a/Form/CreationPersonType.php +++ b/Form/CreationPersonType.php @@ -55,7 +55,6 @@ class CreationPersonType extends AbstractType $dateToStringTransformer = new DateTimeToStringTransformer( null, null, 'dd-MM-yyyy', true); - $builder->add('firstName', 'hidden') ->add('lastName', 'hidden') ->add( $builder->create('birthdate', 'hidden') diff --git a/Resources/config/doctrine/Person.orm.yml b/Resources/config/doctrine/Person.orm.yml index 8e7ae03ee..838ab1e8f 100644 --- a/Resources/config/doctrine/Person.orm.yml +++ b/Resources/config/doctrine/Person.orm.yml @@ -55,6 +55,7 @@ Chill\PersonBundle\Entity\Person: nullable: false maritalStatus: targetEntity: Chill\PersonBundle\Entity\MaritalStatus + nullable: true oneToMany: accompanyingPeriods: targetEntity: AccompanyingPeriod diff --git a/Resources/views/Person/view.html.twig b/Resources/views/Person/view.html.twig index 937415196..e0f817321 100644 --- a/Resources/views/Person/view.html.twig +++ b/Resources/views/Person/view.html.twig @@ -116,7 +116,11 @@ This view should receive those arguments: