The user roles */ #[ORM\Column] private array $roles = []; /** * @var string The hashed password */ #[ORM\Column] private ?string $password = null; #[ORM\Column] private bool $isVerified = false; #[ORM\ManyToOne(inversedBy: 'users')] private ?Festival $currentFestival = null; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Expense::class, mappedBy: 'user')] private Collection $expenses; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Product::class, mappedBy: 'user')] private Collection $products; /** * @var Collection */ #[ORM\OneToMany(targetEntity: GroupOfProducts::class, mappedBy: 'user')] private Collection $groupOfProducts; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Festival::class, mappedBy: 'user')] private Collection $festivals; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Category::class, mappedBy: 'user')] private Collection $categories; public function __construct() { $this->expenses = new ArrayCollection(); $this->products = new ArrayCollection(); $this->groupOfProducts = new ArrayCollection(); $this->festivals = new ArrayCollection(); $this->categories = new ArrayCollection(); } public function getId(): ?int { return $this->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 getOwner(): ?object { return $this->owner; } public function setOwner(object $owner): static { $this->owner = $owner; return $this; } public function getExpenses(): ?object { return $this->expenses; } public function setExpenses(?object $expenses): static { $this->expenses = $expenses; return $this; } public function isVerified(): bool { return $this->isVerified; } public function setIsVerified(bool $isVerified): static { $this->isVerified = $isVerified; return $this; } public function getCurrentFestival(): ?object { return $this->currentFestival; } public function setCurrentFestival(?object $currentFestival): static { $this->currentFestival = $currentFestival; return $this; } public function addExpense(Expense $expense): static { if (!$this->expenses->contains($expense)) { $this->expenses->add($expense); $expense->setUser($this); } return $this; } public function removeExpense(Expense $expense): static { if ($this->expenses->removeElement($expense)) { // set the owning side to null (unless already changed) if ($expense->getUser() === $this) { $expense->setUser(null); } } return $this; } /** * @return Collection */ public function getProducts(): Collection { return $this->products; } public function addProduct(Product $product): static { if (!$this->products->contains($product)) { $this->products->add($product); $product->setUser($this); } return $this; } public function removeProduct(Product $product): static { if ($this->products->removeElement($product)) { // set the owning side to null (unless already changed) if ($product->getUser() === $this) { $product->setUser(null); } } return $this; } /** * @return Collection */ public function getGroupOfProducts(): Collection { return $this->groupOfProducts; } public function addGroupOfProduct(GroupOfProducts $groupOfProduct): static { if (!$this->groupOfProducts->contains($groupOfProduct)) { $this->groupOfProducts->add($groupOfProduct); $groupOfProduct->setUser($this); } return $this; } public function removeGroupOfProduct(GroupOfProducts $groupOfProduct): static { if ($this->groupOfProducts->removeElement($groupOfProduct)) { // set the owning side to null (unless already changed) if ($groupOfProduct->getUser() === $this) { $groupOfProduct->setUser(null); } } return $this; } /** * @return Collection */ public function getFestivals(): Collection { return $this->festivals; } public function addFestival(Festival $festival): static { if (!$this->festivals->contains($festival)) { $this->festivals->add($festival); $festival->setUser($this); } return $this; } public function removeFestival(Festival $festival): static { if ($this->festivals->removeElement($festival)) { // set the owning side to null (unless already changed) if ($festival->getUser() === $this) { $festival->setUser(null); } } return $this; } /** * @return Collection */ public function getCategories(): Collection { return $this->categories; } public function addCategory(Category $category): static { if (!$this->categories->contains($category)) { $this->categories->add($category); $category->setUser($this); } return $this; } public function removeCategory(Category $category): static { if ($this->categories->removeElement($category)) { // set the owning side to null (unless already changed) if ($category->getUser() === $this) { $category->setUser(null); } } return $this; } }