Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
212
/
task
/
212
/
root
/
proc
/
self
/
root
/
proc
/
212
/
root
/
proc
/
70528
/
task
/
70528
/
cwd
/
src
/
Entity
/
//proc/212/task/212/root/proc/self/root/proc/212/root/proc/70528/task/70528/cwd/src/Entity/User.php
<?php namespace App\Entity; use App\Repository\UserRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\UserInterface; /** * @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 = []; /** * @var string The hashed password * @ORM\Column(type="string") */ private $password; /** * @ORM\Column(type="string", length=255) */ private $phone; /** * @ORM\Column(type="string", length=255) */ private $address; /** * @ORM\Column(type="string", length=255) */ private $city; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $addressAddon; /** * @ORM\Column(type="string", length=255) */ private $firstname; /** * @ORM\Column(type="string", length=255) */ private $lastname; /** * @ORM\Column(type="string", length=255) */ private $zipcode; /** * @ORM\OneToMany(targetEntity=Cart::class, mappedBy="user") */ private $carts; /** * @ORM\OneToMany(targetEntity=Command::class, mappedBy="user") */ private $commands; public function __construct() { $this->carts = new ArrayCollection(); $this->commands = new ArrayCollection(); } 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; } /** * @deprecated since Symfony 5.3, use getUserIdentifier instead */ public function getUsername(): 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; } /** * Returning a salt is only needed, if you are not using a modern * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml. * * @see UserInterface */ public function getSalt(): ?string { return null; } /** * @see UserInterface */ public function eraseCredentials() { // If you store any temporary, sensitive data on the user, clear it here // $this->plainPassword = null; } public function getPhone(): ?string { return $this->phone; } public function setPhone(string $phone): self { $this->phone = $phone; return $this; } public function getAddress(): ?string { return $this->address; } public function setAddress(string $address): self { $this->address = $address; return $this; } public function getCity(): ?string { return $this->city; } public function setCity(string $city): self { $this->city = $city; return $this; } public function getAddressAddon(): ?string { return $this->addressAddon; } public function setAddressAddon(?string $addressAddon): self { $this->addressAddon = $addressAddon; return $this; } 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 getZipcode(): ?string { return $this->zipcode; } public function setZipcode(string $zipcode): self { $this->zipcode = $zipcode; return $this; } /** * @return Collection<int, Cart> */ public function getCarts(): Collection { return $this->carts; } public function addCart(Cart $cart): self { if (!$this->carts->contains($cart)) { $this->carts[] = $cart; $cart->setUser($this); } return $this; } public function removeCart(Cart $cart): self { if ($this->carts->removeElement($cart)) { // set the owning side to null (unless already changed) if ($cart->getUser() === $this) { $cart->setUser(null); } } return $this; } /** * @return Collection<int, Command> */ public function getCommands(): Collection { return $this->commands; } public function addCommand(Command $command): self { if (!$this->commands->contains($command)) { $this->commands[] = $command; $command->setUser($this); } return $this; } public function removeCommand(Command $command): self { if ($this->commands->removeElement($command)) { // set the owning side to null (unless already changed) if ($command->getUser() === $this) { $command->setUser(null); } } return $this; } }