Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.01 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Security\Core\User\UserInterface;
  7.  
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  10.  */
  11. class User implements UserInterface
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.  
  20.     /**
  21.      * @ORM\Column(type="string", length=180, unique=true)
  22.      */
  23.     private $email;
  24.  
  25.     /**
  26.      * @ORM\Column(type="json")
  27.      */
  28.     private $roles = [];
  29.  
  30.     /**
  31.      * @var string The hashed password
  32.      * @ORM\Column(type="string")
  33.      */
  34.     private $password;
  35.  
  36.     /**
  37.      * @ORM\Column(type="string", length=100)
  38.      */
  39.     private $firstname;
  40.  
  41.     /**
  42.      * @ORM\Column(type="string", length=100)
  43.      */
  44.     private $lastName;
  45.  
  46.     /**
  47.      * @ORM\Column(type="string", length=255)
  48.      */
  49.     private $adresse;
  50.  
  51.     /**
  52.      * @ORM\Column(type="string", length=5)
  53.      */
  54.     private $zipCode;
  55.  
  56.     /**
  57.      * @ORM\Column(type="string", length=12)
  58.      */
  59.     private $phone;
  60.  
  61.     /**
  62.      * @ORM\Column(type="date")
  63.      */
  64.     private $birth;
  65.  
  66.  
  67.     public function getId(): ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.  
  72.     public function getEmail(): ?string
  73.     {
  74.         return $this->email;
  75.     }
  76.  
  77.     public function setEmail(string $email): self
  78.     {
  79.         $this->email = $email;
  80.  
  81.         return $this;
  82.     }
  83.  
  84.     /**
  85.      * A visual identifier that represents this user.
  86.      *
  87.      * @see UserInterface
  88.      */
  89.     public function getUsername(): string
  90.     {
  91.         return (string) $this->email;
  92.     }
  93.  
  94.     /**
  95.      * @see UserInterface
  96.      */
  97.     public function getRoles(): array
  98.     {
  99.         $roles = $this->roles;
  100.         // guarantee every user at least has ROLE_USER
  101.         $roles[] = 'ROLE_USER';
  102.  
  103.         return array_unique($roles);
  104.     }
  105.  
  106.     public function setRoles(array $roles): self
  107.     {
  108.         $this->roles = $roles;
  109.  
  110.         return $this;
  111.     }
  112.  
  113.     /**
  114.      * @see UserInterface
  115.      */
  116.     public function getPassword(): string
  117.     {
  118.         return (string) $this->password;
  119.     }
  120.  
  121.     public function setPassword(string $password): self
  122.     {
  123.         $this->password = $password;
  124.  
  125.         return $this;
  126.     }
  127.  
  128.     /**
  129.      * @see UserInterface
  130.      */
  131.     public function getSalt()
  132.     {
  133.         // not needed when using the "bcrypt" algorithm in security.yaml
  134.     }
  135.  
  136.     /**
  137.      * @see UserInterface
  138.      */
  139.     public function eraseCredentials()
  140.     {
  141.         // If you store any temporary, sensitive data on the user, clear it here
  142.         // $this->plainPassword = null;
  143.     }
  144.  
  145.     public function getFirstname(): ?string
  146.     {
  147.         return $this->firstname;
  148.     }
  149.  
  150.     public function setFirstname(string $firstname): self
  151.     {
  152.         $this->firstname = $firstname;
  153.  
  154.         return $this;
  155.     }
  156.  
  157.     public function getLastName(): ?string
  158.     {
  159.         return $this->lastName;
  160.     }
  161.  
  162.     public function setLastName(string $lastName): self
  163.     {
  164.         $this->lastName = $lastName;
  165.  
  166.         return $this;
  167.     }
  168.  
  169.    
  170.     public function getAdresse(): ?string
  171.     {
  172.         return $this->adresse;
  173.     }
  174.  
  175.     public function setAdresse(string $adresse): self
  176.     {
  177.         $this->adresse = $adresse;
  178.  
  179.         return $this;
  180.     }
  181.  
  182.     public function getZipCode(): ?string
  183.     {
  184.         return $this->zipCode;
  185.     }
  186.  
  187.     public function setZipCode(string $zipCode): self
  188.     {
  189.         $this->zipCode = $zipCode;
  190.  
  191.         return $this;
  192.     }
  193.  
  194.     public function getPhone(): ?string
  195.     {
  196.         return $this->phone;
  197.     }
  198.  
  199.     public function setPhone(string $phone): self
  200.     {
  201.         $this->phone = $phone;
  202.  
  203.         return $this;
  204.     }
  205.  
  206.     public function getBirth(): ?\DateTimeInterface
  207.     {
  208.         return $this->birth;
  209.     }
  210.  
  211.     public function setBirth(\DateTimeInterface $birth): self
  212.     {
  213.         $this->birth = $birth;
  214.  
  215.         return $this;
  216.     }
  217.  
  218. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement