This commit is contained in:
Ryan Prather 2024-12-07 22:52:49 -05:00
parent 09f9ef1ef5
commit b9bc947466

View File

@ -53,12 +53,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column(type: Types::DECIMAL, precision: 6, scale: 2)]
private ?string $rate = null;
/**
* @var Collection<int, UserCase>
*/
#[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<int, UserCase>
*/
#[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;