diff --git a/src/Entity/CaseItinerary.php b/src/Entity/Case/CaseItinerary.php similarity index 89% rename from src/Entity/CaseItinerary.php rename to src/Entity/Case/CaseItinerary.php index 7eda2ba..68e9dab 100644 --- a/src/Entity/CaseItinerary.php +++ b/src/Entity/Case/CaseItinerary.php @@ -1,8 +1,10 @@ arrival; - } - - public function setArrival(?\DateTimeInterface $arrival): static - { - $this->arrival = $arrival; - - return $this; - } - public function getDestLocation(): ?Location { return $this->destLocation; @@ -132,7 +119,7 @@ class CaseItinerary public function calcDuration() { - $this->duration = $this->departure - $this->arrival; + //$this->duration = $this->departure - $this->arrival; } public function getMemberCase(): ?MemberCase @@ -203,10 +190,13 @@ class CaseItinerary public function destinationInfoWindow(): string { + /** @var DateTime $arrival */ + $arrival = $this->departure; + $arrival->add($this->duration); return <<destLocation->getName()}
{$this->destLocation->getFormattedAddress()}
- {$this->arrival->format("g:i a")} + {$arrival->format("g:i a")} EOL; } } diff --git a/src/Entity/CaseLocation.php b/src/Entity/Case/CaseLocation.php similarity index 91% rename from src/Entity/CaseLocation.php rename to src/Entity/Case/CaseLocation.php index 7a89c5e..a180e33 100644 --- a/src/Entity/CaseLocation.php +++ b/src/Entity/Case/CaseLocation.php @@ -1,8 +1,9 @@ staffNotes->clear(); + return $this; + } } diff --git a/src/Entity/MemberDocument.php b/src/Entity/Case/MemberDocument.php similarity index 86% rename from src/Entity/MemberDocument.php rename to src/Entity/Case/MemberDocument.php index 4141a08..e1b2e28 100644 --- a/src/Entity/MemberDocument.php +++ b/src/Entity/Case/MemberDocument.php @@ -1,8 +1,10 @@ id; @@ -129,4 +134,16 @@ class MemberDocument return $this; } + + public function getDocData(): ?string + { + return $this->docData; + } + + public function setDocData(?string $docData): static + { + $this->docData = $docData; + + return $this; + } } diff --git a/src/Entity/Case/MonthlyCaseNote.php b/src/Entity/Case/MonthlyCaseNote.php new file mode 100644 index 0000000..273e1f9 --- /dev/null +++ b/src/Entity/Case/MonthlyCaseNote.php @@ -0,0 +1,115 @@ +id; + } + + public function getReason(): ?string + { + return $this->reason; + } + + public function setReason(?string $reason): static + { + $this->reason = $reason; + + return $this; + } + + public function getFamilyStrength(): ?string + { + return $this->familyStrength; + } + + public function setFamilyStrength(?string $familyStrength): static + { + $this->familyStrength = $familyStrength; + + return $this; + } + + public function getRecAndProgress(): ?string + { + return $this->recAndProgress; + } + + public function setRecAndProgress(?string $recAndProgress): static + { + $this->recAndProgress = $recAndProgress; + + return $this; + } + + public function getMemberCase(): ?MemberCase + { + return $this->memberCase; + } + + public function setMemberCase(?MemberCase $memberCase): static + { + $this->memberCase = $memberCase; + + return $this; + } + + public function getDate(): ?\DateTimeInterface + { + return $this->date; + } + + public function setDate(\DateTimeInterface $date): static + { + $this->date = $date; + + return $this; + } + + public function getNextVisit(): ?\DateTimeInterface + { + return $this->nextVisit; + } + + public function setNextVisit(\DateTimeInterface $nextVisit): static + { + $this->nextVisit = $nextVisit; + + return $this; + } +} diff --git a/src/Entity/Note.php b/src/Entity/Case/Note.php similarity index 96% rename from src/Entity/Note.php rename to src/Entity/Case/Note.php index 2d6614f..858e389 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Case/Note.php @@ -1,11 +1,11 @@ id; + } + + public function getUser(): ?User + { + return $this->user; + } + + public function setUser(?User $user): static + { + $this->user = $user; + + return $this; + } + + public function isActive(): ?bool + { + return $this->active; + } + + public function setActive(bool $active): static + { + $this->active = $active; + + return $this; + } + + public function getExpiration(): ?\DateTimeInterface + { + return $this->expiration; + } + + public function setExpiration(\DateTimeInterface $expiration): static + { + $this->expiration = $expiration; + + return $this; + } + + public function getLevel(): ?UserSubscriptions + { + return $this->level; + } + + public function setLevel(UserSubscriptions $level): static + { + $this->level = $level; + + return $this; + } +} diff --git a/src/Entity/User.php b/src/Entity/System/User.php similarity index 89% rename from src/Entity/User.php rename to src/Entity/System/User.php index 58b508f..d24384d 100644 --- a/src/Entity/User.php +++ b/src/Entity/System/User.php @@ -1,10 +1,11 @@ + */ + #[ORM\OneToMany(targetEntity: Subscription::class, mappedBy: 'user', orphanRemoval: true)] + private Collection $subscriptions; + public function __construct() { $this->userCases = new ArrayCollection(); + $this->subscriptions = new ArrayCollection(); } public function getId(): ?Uuid @@ -441,4 +449,34 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ($this->imageName ? "\nPHOTO;TYPE={$fileExt};ENCODING=b:{$b64image}" : null) . "\nEND:VCARD"; } + + /** + * @return Collection + */ + public function getSubscriptions(): Collection + { + return $this->subscriptions; + } + + public function addSubscription(Subscription $subscription): static + { + if (!$this->subscriptions->contains($subscription)) { + $this->subscriptions->add($subscription); + $subscription->setUser($this); + } + + return $this; + } + + public function removeSubscription(Subscription $subscription): static + { + if ($this->subscriptions->removeElement($subscription)) { + // set the owning side to null (unless already changed) + if ($subscription->getUser() === $this) { + $subscription->setUser(null); + } + } + + return $this; + } } diff --git a/src/Entity/UserCase.php b/src/Entity/System/UserCase.php similarity index 91% rename from src/Entity/UserCase.php rename to src/Entity/System/UserCase.php index d7580a5..c567b5d 100644 --- a/src/Entity/UserCase.php +++ b/src/Entity/System/UserCase.php @@ -1,9 +1,9 @@