From 44625b9686e44222912c2eea8bc16b51ebfbe7b0 Mon Sep 17 00:00:00 2001 From: Babak Alizadeh Date: Sun, 5 Nov 2023 12:48:12 -0800 Subject: [PATCH] add birthday to persons entity --- hesabixCore/src/Controller/PersonsController.php | 2 ++ hesabixCore/src/Entity/Person.php | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/hesabixCore/src/Controller/PersonsController.php b/hesabixCore/src/Controller/PersonsController.php index 6c4fb99..0690f12 100644 --- a/hesabixCore/src/Controller/PersonsController.php +++ b/hesabixCore/src/Controller/PersonsController.php @@ -69,6 +69,8 @@ class PersonsController extends AbstractController $person->setNikename($params['nikename']); if(array_key_exists('name',$params)) $person->setName($params['name']); + if(array_key_exists('birthday',$params)) + $person->setBirthday($params['birthday']); if(array_key_exists('tel',$params)) $person->setTel($params['tel']); if(array_key_exists('address',$params)) diff --git a/hesabixCore/src/Entity/Person.php b/hesabixCore/src/Entity/Person.php index d9d76ae..b36e524 100644 --- a/hesabixCore/src/Entity/Person.php +++ b/hesabixCore/src/Entity/Person.php @@ -107,6 +107,9 @@ class Person #[ORM\OneToMany(mappedBy: 'Person', targetEntity: StoreroomTicket::class)] private Collection $storeroomTickets; + #[ORM\Column(length: 255, nullable: true)] + private ?string $birthday = null; + public function __construct() { $this->hesabdariRows = new ArrayCollection(); @@ -527,4 +530,16 @@ class Person return $this; } + + public function getBirthday(): ?string + { + return $this->birthday; + } + + public function setBirthday(?string $birthday): static + { + $this->birthday = $birthday; + + return $this; + } }