From 91723ed9bec8582a9b34a136a0fc3555cad3979d Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Sun, 5 Jan 2025 06:03:42 +0000 Subject: [PATCH] reconfigure --- src/Entity/Note.php | 65 ++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 0fabaa0..2d6614f 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -6,8 +6,6 @@ use App\Enums\NoteLocation; use App\Enums\NoteMethod; use App\Enums\NoteStatus; use App\Repository\NoteRepository; -use DateTime; -use Doctrine\Common\Collections\Collection; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\MappedSuperclass; @@ -39,18 +37,19 @@ class Note #[ORM\Column(enumType: NoteStatus::class)] private ?NoteStatus $status = null; - /** - * @var Collection - */ - #[ORM\OneToMany(targetEntity: Member::class, mappedBy: 'note')] - public Collection $members; - #[ORM\Column(enumType: NoteLocation::class)] private ?NoteLocation $location = null; #[ORM\Column(enumType: NoteMethod::class)] private ?NoteMethod $method = null; + private ?array $members = null; + + public function __construct() + { + $this->members = []; + } + public function getId(): ?UUid { return $this->id; @@ -116,37 +115,6 @@ class Note return $this; } - /** - * @return Collection - */ - public function getMembers(): Collection - { - return $this->members; - } - - public function addUser(Member $member): static - { - if (!$this->members->contains($member)) { - $this->members->add($member); - } - - return $this; - } - - public function removeUser(Member $member): static - { - $this->members->removeElement($member); - - return $this; - } - - public function setMembers(?array $members): static - { - $this->members = $members; - - return $this; - } - public function getLocation(): ?NoteLocation { return $this->location; @@ -171,6 +139,25 @@ class Note return $this; } + public function getMembers(): ?array + { + return $this->members; + } + + public function setMembers(?array $members): static + { + $this->members = $members; + + return $this; + } + + public function addMember(Member $member): static + { + $this->members[] = $member; + + return $this; + } + /** * Method to calculate the number of minutes used for a visit rounded to the nearest 15 min increment *