Other various changes
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user