/
home
/
obinna
/
html
/
boaz
/
src
/
Entity
/
Upload File
HOME
<?php namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity(repositoryClass="App\Repository\UserRepository") * @ORM\Table(name="user") */ class User implements UserInterface { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") * @var int */ private $id; /** * @ORM\Column(type="string", length=180, unique=true) * @Assert\Unique(message="Username already taken") * @var string */ private $username; /** * @ORM\Column(type="string", length=255) * @var string */ private $password; /** * @ORM\Column(type="json") * @var array */ private $roles = []; /** * @var string * * @ORM\Column(name="role", type="string", length=20) */ private $role; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $name; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $reset; /** * @ORM\Column(type="boolean", nullable=true) */ private $enabled; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $email; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $telephone; /** * @ORM\OneToMany(targetEntity="App\Entity\Loading", mappedBy="user") * * @var Loading **/ private $loading; /** * @ORM\OneToMany(targetEntity="App\Entity\ReleaseOrder", mappedBy="user") * * @var release **/ private $release; /** * Get ID * @return int|null */ public function getId(): ?int { return $this->id; } /** * A visual identifier that represents this user. * * @return string */ public function getUsername(): string { return (string) $this->username; } /** * A visual identifier that represents this user. * * @param string $username */ public function setUsername(string $username) { return $this->username = $username; } /** * @return (Role|string)[] */ public function getRoles(): array { $roles = $this->role ? ['ROLE_' . $this->role] : []; // guarantee every user at least has ROLE_USER $roles[] = 'ROLE_REP'; return array_unique($roles); } /** * Set roles * @param array $roles * @return self */ public function setRoles(array $roles): self { $this->roles = $roles; return $this; } /** * @see UserInterface */ public function getPassword() { return $this->password; } /** * Set Password * @param string $password * @return self */ public function setPassword(string $password): self { $this->password = $password; return $this; } /** * @see UserInterface */ public function getSalt() { // not needed for apps that do not check user passwords } /** * @see UserInterface */ public function eraseCredentials() { // If you store any temporary, sensitive data on the user, clear it here // $this->plainPassword = null; } public function getRole(): ?string { return $this->role; } public function setRole(?string $role): self { $this->role = $role; return $this; } public function getName(): ?string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getReset(): ?string { return $this->reset; } public function setReset(?string $reset): self { $this->reset = $reset; return $this; } public function getEnabled(): ?bool { return $this->enabled; } public function setEnabled(?bool $enabled): self { $this->enabled = $enabled; return $this; } public function getVerification(): ?string { return $this->verification; } public function setVerification(?string $verification): self { $this->verification = $verification; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(?string $email): self { $this->email = $email; return $this; } public function getTelephone(): ?string { return $this->telephone; } public function setTelephone(?string $telephone): self { $this->telephone = $telephone; return $this; } }