src/Entity/User.php line 18
<?phpnamespace App\Entity;use App\Repository\UserRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;use Symfony\Component\Security\Core\User\UserInterface;/*** @UniqueEntity(fields={"email"}, message="There is already an account with this email")*/#[ORM\Entity(repositoryClass: UserRepository::class)]#[ORM\Table(name: '`user`')]class User implements UserInterface, PasswordAuthenticatedUserInterface{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column(type: 'integer')]private $id;#[ORM\Column(type: 'string', length: 180, unique: true)]private $email;#[ORM\Column(type: 'json')]private $roles = [];#[ORM\Column(type: 'string')]private $password;#[ORM\Column(type: 'string', length: 255)]private $firstName;#[ORM\Column(type: 'string', length: 255)]private $lastName;#[ORM\Column(type: 'datetime_immutable')]private $createdAt;#[ORM\OneToMany(mappedBy: 'atUser', targetEntity: Adress::class, orphanRemoval: false)]private $adress;#[ORM\Column(type: 'boolean')]private $isVerified = false;#[ORM\OneToMany(mappedBy: 'userOf', targetEntity: Order::class)]private $orders;#[ORM\OneToMany(mappedBy: 'forUser', targetEntity: Notifications::class, orphanRemoval: true)]private $notifications;#[ORM\Column(type: 'string', length: 255, nullable: true)]private $stripeUserId;#[ORM\Column(type: 'string', length: 255, nullable: true)]private $societe;#[ORM\Column(type: 'boolean')]private $IsBanned;#[ORM\OneToMany(mappedBy: 'userOf', targetEntity: Help::class)]private Collection $helps;public function __construct(){$this->createdAt = new \DateTimeImmutable();$this->adress = new ArrayCollection();$this->orders = new ArrayCollection();$this->notifications = new ArrayCollection();$this->IsBanned = false;$this->helps = new ArrayCollection();}public function __toString(){return $this->firstName . ' ' . $this->lastName;}public function getId(): ?int{return $this->id;}public function getEmail(): ?string{return $this->email;}public function setEmail(string $email): self{$this->email = $email;return $this;}/*** A visual identifier that represents this user.** @see UserInterface*/public function getUserIdentifier(): string{return (string) $this->email;}/*** @see UserInterface*/public function getRoles(): array{$roles = $this->roles;// guarantee every user at least has ROLE_USER$roles[] = 'ROLE_USER';return array_unique($roles);}public function setRoles(array $roles): self{$this->roles = $roles;return $this;}/*** @see PasswordAuthenticatedUserInterface*/public function getPassword(): string{return $this->password;}public function setPassword(string $password): self{$this->password = $password;return $this;}/*** @see UserInterface*/public function eraseCredentials(){// If you store any temporary, sensitive data on the user, clear it here// $this->plainPassword = null;}public function getFirstName(): ?string{return $this->firstName;}public function setFirstName(string $firstName): self{$this->firstName = $firstName;return $this;}public function getLastName(): ?string{return $this->lastName;}public function setLastName(string $lastName): self{$this->lastName = $lastName;return $this;}public function getCreatedAt(): ?\DateTimeImmutable{return $this->createdAt;}public function setCreatedAt(\DateTimeImmutable $createdAt): self{$this->createdAt = $createdAt;return $this;}/*** @return Collection|Adress[]*/public function getAdress(): Collection{return $this->adress;}public function addAdress(Adress $adress): self{if (!$this->adress->contains($adress)) {$this->adress[] = $adress;$adress->setAtUser($this);}return $this;}public function removeAdress(Adress $adress): self{if ($this->adress->removeElement($adress)) {// set the owning side to null (unless already changed)if ($adress->getAtUser() === $this) {$adress->setAtUser(null);}}return $this;}public function isVerified(): bool{return $this->isVerified;}public function setIsVerified(bool $isVerified): self{$this->isVerified = $isVerified;return $this;}/*** @return Collection|Order[]*/public function getOrders(): Collection{return $this->orders;}public function addOrder(Order $order): self{if (!$this->orders->contains($order)) {$this->orders[] = $order;$order->setUserOf($this);}return $this;}public function removeOrder(Order $order): self{if ($this->orders->removeElement($order)) {// set the owning side to null (unless already changed)if ($order->getUserOf() === $this) {$order->setUserOf(null);}}return $this;}/*** @return Collection|Notifications[]*/public function getNotifications(): Collection{return $this->notifications;}public function addNotification(Notifications $notification): self{if (!$this->notifications->contains($notification)) {$this->notifications[] = $notification;$notification->setForUser($this);}return $this;}public function removeNotification(Notifications $notification): self{if ($this->notifications->removeElement($notification)) {// set the owning side to null (unless already changed)if ($notification->getForUser() === $this) {$notification->setForUser(null);}}return $this;}public function getStripeUserId(): ?string{return $this->stripeUserId;}public function setStripeUserId(?string $stripeUserId): self{$this->stripeUserId = $stripeUserId;return $this;}public function getSociete(): ?string{return $this->societe;}public function setSociete(?string $societe): self{$this->societe = $societe;return $this;}public function getIsBanned(): ?bool{return $this->IsBanned;}public function setIsBanned(bool $IsBanned): self{$this->IsBanned = $IsBanned;return $this;}/*** @return Collection<int, Help>*/public function getHelps(): Collection{return $this->helps;}public function addHelp(Help $help): self{if (!$this->helps->contains($help)) {$this->helps->add($help);$help->setUserOf($this);}return $this;}public function removeHelp(Help $help): self{if ($this->helps->removeElement($help)) {// set the owning side to null (unless already changed)if ($help->getUserOf() === $this) {$help->setUserOf(null);}}return $this;}}