src/Entity/Users.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  4. use Symfony\Component\Security\Core\User\UserInterface;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Users
  8.  *
  9.  * @ORM\Table(name="users", uniqueConstraints={@ORM\UniqueConstraint(name="UNIQ_1483A5E9E7927C74", columns={"email"})})
  10.  * @ORM\Entity
  11.  */
  12. class Users implements UserInterfacePasswordAuthenticatedUserInterface
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer", nullable=false)
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="IDENTITY")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column(name="email", type="string", length=180, nullable=false)
  26.      */
  27.     private $email;
  28.     /**
  29.      * @var array
  30.      *
  31.      * @ORM\Column(name="roles", type="json", nullable=false)
  32.      */
  33.     private $roles;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(name="password", type="string", length=255, nullable=false)
  38.      */
  39.     private $password;
  40.     /**
  41.      * @var string
  42.      *
  43.      * @ORM\Column(name="lastname", type="string", length=100, nullable=false)
  44.      */
  45.     private $lastname;
  46.     /**
  47.      * @var string
  48.      *
  49.      * @ORM\Column(name="firstname", type="string", length=100, nullable=false)
  50.      */
  51.     private $firstname;
  52.     /**
  53.      * @var string
  54.      *
  55.      * @ORM\Column(name="address", type="string", length=255, nullable=false)
  56.      */
  57.     private $address;
  58.     /**
  59.      * @var string
  60.      *
  61.      * @ORM\Column(name="zipcode", type="string", length=5, nullable=false)
  62.      */
  63.     private $zipcode;
  64.     /**
  65.      * @var string
  66.      *
  67.      * @ORM\Column(name="city", type="string", length=150, nullable=false)
  68.      */
  69.     private $city;
  70.     /**
  71.      * @var bool
  72.      *
  73.      * @ORM\Column(name="is_verified", type="boolean", nullable=false)
  74.      */
  75.     private $isVerified;
  76.     /**
  77.      * @var string|null
  78.      *
  79.      * @ORM\Column(name="reset_token", type="string", length=255, nullable=true)
  80.      */
  81.     private $resetToken;
  82.     /**
  83.      * @var \DateTime|null
  84.      *
  85.      * @ORM\Column(name="created_at", type="datetime", nullable=true)
  86.      */
  87.     private $createdAt;
  88.     /**
  89.      * @var int|null
  90.      *
  91.      * @ORM\Column(name="contributeur", type="integer", nullable=true)
  92.      */
  93.     private $contributeur;
  94.     /**
  95.      * @var string|null
  96.      *
  97.      * @ORM\Column(name="code_user", type="string", length=255, nullable=true)
  98.      */
  99.     private $codeUser;
  100.     /**
  101.      * @var string|null
  102.      *
  103.      * @ORM\Column(name="linkedin", type="string", length=255, nullable=true)
  104.      */
  105.     private $linkedin;
  106.     /**
  107.      * @var string|null
  108.      *
  109.      * @ORM\Column(name="facebook", type="string", length=255, nullable=true)
  110.      */
  111.     private $facebook;
  112.     /**
  113.      * @var string|null
  114.      *
  115.      * @ORM\Column(name="siteweb", type="string", length=255, nullable=true)
  116.      */
  117.     private $siteweb;
  118.     /**
  119.      * @var string|null
  120.      *
  121.      * @ORM\Column(name="langue", type="string", length=255, nullable=true)
  122.      */
  123.     private $langue;
  124.    
  125.     /**
  126.      * @var string|null
  127.      *
  128.      * @ORM\Column(name="gmail_compte", type="string", length=255, nullable=true)
  129.      */
  130.     private $gmailCompte;
  131.     /**
  132.      * @var string|null
  133.      *
  134.      * @ORM\Column(name="photo", type="string", length=255, nullable=true)
  135.      */
  136.     private $photo;
  137.     /**
  138.      * @var string|null
  139.      *
  140.      * @ORM\Column(name="cv", type="string", length=255, nullable=true)
  141.      */
  142.     private $cv;
  143.     
  144.     
  145.   
  146.     
  147.     public function getId(): ?int
  148.     {
  149.         return $this->id;
  150.     }
  151.     public function getEmail(): ?string
  152.     {
  153.         return $this->email;
  154.     }
  155.     public function setEmail(string $email): self
  156.     {
  157.         $this->email $email;
  158.         return $this;
  159.     }
  160.     public function getRoles(): array
  161.     {
  162.         return $roles $this->roles;
  163.         // Ensure the user always has at least one role (e.g., ROLE_USER)
  164.         //$roles[] = 'ROLE_USER';
  165.         //return array_unique($roles);
  166.     }
  167.     public function setRoles(array $roles): self
  168.     {
  169.         $this->roles $roles;
  170.         return $this;
  171.     }
  172.     public function getPassword(): ?string
  173.     {
  174.         return $this->password;
  175.     }
  176.     public function setPassword(string $password): self
  177.     {
  178.         $this->password $password;
  179.         return $this;
  180.     }
  181.     public function getLastname(): ?string
  182.     {
  183.         return $this->lastname;
  184.     }
  185.     public function setLastname(string $lastname): self
  186.     {
  187.         $this->lastname $lastname;
  188.         return $this;
  189.     }
  190.     public function getFirstname(): ?string
  191.     {
  192.         return $this->firstname;
  193.     }
  194.     public function setFirstname(string $firstname): self
  195.     {
  196.         $this->firstname $firstname;
  197.         return $this;
  198.     }
  199.     public function getAddress(): ?string
  200.     {
  201.         return $this->address;
  202.     }
  203.     public function setAddress(string $address): self
  204.     {
  205.         $this->address $address;
  206.         return $this;
  207.     }
  208.     public function getZipcode(): ?string
  209.     {
  210.         return $this->zipcode;
  211.     }
  212.     public function setZipcode(string $zipcode): self
  213.     {
  214.         $this->zipcode $zipcode;
  215.         return $this;
  216.     }
  217.     public function getCity(): ?string
  218.     {
  219.         return $this->city;
  220.     }
  221.     public function setCity(string $city): self
  222.     {
  223.         $this->city $city;
  224.         return $this;
  225.     }
  226.     public function isIsVerified(): ?bool
  227.     {
  228.         return $this->isVerified;
  229.     }
  230.     public function setIsVerified(bool $isVerified): self
  231.     {
  232.         $this->isVerified $isVerified;
  233.         return $this;
  234.     }
  235.     public function getResetToken(): ?string
  236.     {
  237.         return $this->resetToken;
  238.     }
  239.     public function setResetToken(?string $resetToken): self
  240.     {
  241.         $this->resetToken $resetToken;
  242.         return $this;
  243.     }
  244.     public function getCreatedAt(): ?\DateTimeInterface
  245.     {
  246.         return $this->createdAt;
  247.     }
  248.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  249.     {
  250.         $this->createdAt $createdAt;
  251.         return $this;
  252.     }
  253.     public function getContributeur(): ?int
  254.     {
  255.         return $this->contributeur;
  256.     }
  257.     public function setContributeur(?int $contributeur): self
  258.     {
  259.         $this->contributeur $contributeur;
  260.         return $this;
  261.     }
  262.     public function getCodeUser(): ?string
  263.     {
  264.         return $this->codeUser;
  265.     }
  266.     public function setCodeUser(?string $codeUser): self
  267.     {
  268.         $this->codeUser $codeUser;
  269.         return $this;
  270.     }
  271.     public function getLinkedin(): ?string
  272.     {
  273.         return $this->linkedin;
  274.     }
  275.     public function setLinkedin(?string $linkedin): self
  276.     {
  277.         $this->linkedin $linkedin;
  278.         return $this;
  279.     }
  280.     public function getFacebook(): ?string
  281.     {
  282.         return $this->facebook;
  283.     }
  284.     public function setFacebook(?string $facebook): self
  285.     {
  286.         $this->facebook $facebook;
  287.         return $this;
  288.     }
  289.     public function getSiteweb(): ?string
  290.     {
  291.         return $this->siteweb;
  292.     }
  293.     public function setSiteweb(?string $siteweb): self
  294.     {
  295.         $this->siteweb $siteweb;
  296.         return $this;
  297.     }
  298.     public function getLangue(): ?string
  299.     {
  300.         return $this->langue;
  301.     }
  302.     public function setLangue(?string $langue): self
  303.     {
  304.         $this->langue $langue;
  305.         return $this;
  306.     }
  307.    
  308.     public function getGmailCompte(): ?string
  309.     {
  310.         return $this->gmailCompte;
  311.     }
  312.     public function setGmailCompte(?string $gmailCompte): self
  313.     {
  314.         $this->gmailCompte $gmailCompte;
  315.         return $this;
  316.     }
  317.     public function getPhoto(): ?string
  318.     {
  319.         return $this->photo;
  320.     }
  321.     public function setPhoto(?string $photo): self
  322.     {
  323.         $this->photo $photo;
  324.         return $this;
  325.     }
  326.     public function getCv(): ?string
  327.     {
  328.         return $this->cv;
  329.     }
  330.     public function setCv(?string $cv): self
  331.     {
  332.         $this->cv $cv;
  333.         return $this;
  334.     }
  335.    
  336.    
  337. /* 
  338. public function __consrtuct(){
  339.     $this->createdAt = \DateTimeImmutable::createFromMutable(new \DateTime());
  340. }*/
  341. public function getSalt()
  342. {
  343.     return null;    
  344. }
  345. public function getUsername()
  346. {
  347.     return $this->firstname;
  348. }
  349. public function eraseCredentials()
  350. {
  351.     // Implement any logic to erase sensitive user data here.
  352.     // This method is called after authentication and can be used
  353.     // to remove any plain-text passwords or other sensitive information.
  354. }
  355. public function getUserIdentifier(): string
  356. {
  357.     return $this->id;
  358. }
  359. }