From 980affbfbb6f18edecf7afd2f2d48baf891546be Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Sun, 5 Jan 2025 06:08:02 +0000 Subject: [PATCH] add personal and work phone --- src/Entity/User.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/Entity/User.php b/src/Entity/User.php index 7642b84..11a1024 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -92,6 +92,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $passwordChanged = null; + #[ORM\Column(length: 15, nullable: true)] + private ?string $personalPhone = null; + + #[ORM\Column(length: 15)] + private ?string $workPhone = null; + public function __construct() { $this->userCases = new ArrayCollection(); @@ -399,4 +405,38 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface return $this; } + + public function getPersonalPhone(): ?string + { + return $this->personalPhone; + } + + public function setPersonalPhone(?string $personalPhone): static + { + $this->personalPhone = $personalPhone; + + return $this; + } + + public function getWorkPhone(): ?string + { + return $this->workPhone; + } + + public function setWorkPhone(string $workPhone): static + { + $this->workPhone = $workPhone; + + return $this; + } + + public function getFormattedPhone(): ?string + { + $ret = ''; + if ($this->workPhone) { + $ret = '(' . substr($this->workPhone, 0, 3) . ') ' . substr($this->workPhone, 3, 3) . '-' . substr($this->workPhone, 6); + } + + return $ret; + } }