From b9bc947466b74f8c8f9993b3ca48becd86cf3ac2 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Sat, 7 Dec 2024 22:52:49 -0500 Subject: [PATCH] Fix --- src/Entity/User.php | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/src/Entity/User.php b/src/Entity/User.php index 91bcf23..94fa4de 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -53,12 +53,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface #[ORM\Column(type: Types::DECIMAL, precision: 6, scale: 2)] private ?string $rate = null; - /** - * @var Collection - */ - #[ORM\OneToMany(targetEntity: UserCase::class, mappedBy: 'userId')] - private Collection $userCases; - #[ORM\ManyToOne(inversedBy: 'users')] #[ORM\JoinColumn(nullable: true)] private ?Company $company = null; @@ -80,6 +74,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface #[ORM\Column] private ?bool $su = null; + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: UserCase::class, mappedBy: 'user')] + private Collection $userCases; + public function __construct() { $this->userCases = new ArrayCollection(); @@ -216,28 +216,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface return $this->userCases; } - public function addUserCase(UserCase $userCase): static - { - if (!$this->userCases->contains($userCase)) { - $this->userCases->add($userCase); - $userCase->setUserId($this); - } - - return $this; - } - - public function removeUserCase(UserCase $userCase): static - { - if ($this->userCases->removeElement($userCase)) { - // set the owning side to null (unless already changed) - if ($userCase->getUserId() === $this) { - $userCase->setUserId(null); - } - } - - return $this; - } - public function getCompany(): ?Company { return $this->company;