The user roles */ #[ORM\Column] private array $roles = []; /** * @var string The hashed password */ #[ORM\Column] private ?string $password = null; #[ORM\Column(length: 255)] private ?string $name = null; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Series::class, mappedBy: 'user')] private Collection $series; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Speaker::class, mappedBy: 'user')] private Collection $speakers; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Template::class, mappedBy: 'user')] private Collection $templates; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Note::class, mappedBy: 'user')] private Collection $notes; #[ORM\Column(nullable: true)] private ?array $metaData = null; #[ORM\Column(length: 255, nullable: true)] private ?string $homeChurchRSS = null; public function __construct() { $this->series = new ArrayCollection(); $this->speakers = new ArrayCollection(); $this->templates = new ArrayCollection(); $this->notes = new ArrayCollection(); } public function getId(): ?Uuid { return $this->id; } public function getHexId(): string { return $this->id->toHex(); } public function setId(?Uuid $id): static { $this->id = $id; return $this; } public static function idFromString(string $id): Uuid { return Uuid::fromString($id); } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): static { $this->email = $email; return $this; } /** * A visual identifier that represents this user. * * @see UserInterface */ public function getUserIdentifier(): string { return (string) $this->email; } /** * @see UserInterface * * @return list */ public function getRoles(): array { $roles = $this->roles; // guarantee every user at least has ROLE_USER $roles[] = 'ROLE_USER'; return array_unique($roles); } /** * @param list $roles */ public function setRoles(array $roles): static { $this->roles = $roles; return $this; } /** * @see PasswordAuthenticatedUserInterface */ public function getPassword(): string { return $this->password; } public function setPassword(string $password): static { $this->password = $password; return $this; } /** * @see UserInterface */ public function eraseCredentials(): void { // If you store any temporary, sensitive data on the user, clear it here // $this->plainPassword = null; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } /** * @return Collection */ public function getSeries(): Collection { return $this->series; } public function addSeries(Series $series): static { if (!$this->series->contains($series)) { $this->series->add($series); $series->setUser($this); } return $this; } public function removeSeries(Series $series): static { if ($this->series->removeElement($series)) { // set the owning side to null (unless already changed) if ($series->getUser() === $this) { $series->setUser(null); } } return $this; } /** * @return Collection */ public function getSpeakers(): Collection { return $this->speakers; } public function addSpeaker(Speaker $speaker): static { if (!$this->speakers->contains($speaker)) { $this->speakers->add($speaker); $speaker->setUser($this); } return $this; } public function removeSpeaker(Speaker $speaker): static { if ($this->speakers->removeElement($speaker)) { // set the owning side to null (unless already changed) if ($speaker->getUser() === $this) { $speaker->setUser(null); } } return $this; } /** * @return Collection */ public function getTemplates(): Collection { return $this->templates; } public function addTemplate(Template $template): static { if (!$this->templates->contains($template)) { $this->templates->add($template); $template->setUser($this); } return $this; } public function removeTemplate(Template $template): static { if ($this->templates->removeElement($template)) { // set the owning side to null (unless already changed) if ($template->getUser() === $this) { $template->setUser(null); } } return $this; } /** * @return Collection */ public function getNotes(): Collection { return $this->notes; } public function addNote(Note $note): static { if (!$this->notes->contains($note)) { $this->notes->add($note); $note->setUser($this); } return $this; } public function removeNote(Note $note): static { if ($this->notes->removeElement($note)) { // set the owning side to null (unless already changed) if ($note->getUser() === $this) { $note->setUser(null); } } return $this; } public function jsonSerialize(): array { return [ 'id' => $this->id, 'email' => $this->email, 'name' => $this->name, ]; } public function getMetaData(): ?array { return $this->metaData; } public function setMetaData(?array $metaData): static { $this->metaData = $metaData; return $this; } public function getHomeChurchRSS(): ?string { return $this->homeChurchRSS; } public function setHomeChurchRSS(?string $homeChurchRSS): static { $this->homeChurchRSS = $homeChurchRSS; return $this; } }