Other various changes

This commit is contained in:
2025-04-04 15:27:16 -04:00
parent 6af5f2a3f8
commit f114843e4c
20 changed files with 231 additions and 190 deletions

View File

@ -68,12 +68,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, JsonSer
#[ORM\OneToMany(targetEntity: Note::class, mappedBy: 'user')]
private Collection $notes;
/**
* @var Collection<int, NoteShares>
*/
#[ORM\OneToMany(targetEntity: NoteShares::class, mappedBy: 'ownerId', orphanRemoval: true)]
private Collection $noteShares;
#[ORM\Column(nullable: true)]
private ?array $metaData = null;
@ -83,7 +77,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, JsonSer
$this->speakers = new ArrayCollection();
$this->templates = new ArrayCollection();
$this->notes = new ArrayCollection();
$this->noteShares = new ArrayCollection();
}
public function getId(): ?Uuid
@ -319,36 +312,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, JsonSer
];
}
/**
* @return Collection<int, NoteShares>
*/
public function getNoteShares(): Collection
{
return $this->noteShares;
}
public function addNoteShare(NoteShares $noteShare): static
{
if (!$this->noteShares->contains($noteShare)) {
$this->noteShares->add($noteShare);
$noteShare->setOwner($this);
}
return $this;
}
public function removeNoteShare(NoteShares $noteShare): static
{
if ($this->noteShares->removeElement($noteShare)) {
// set the owning side to null (unless already changed)
if ($noteShare->getOwner() === $this) {
$noteShare->setOwner(null);
}
}
return $this;
}
public function getMetaData(): ?array
{
return $this->metaData;