SHARE
TWEET

User.php

a guest Dec 11th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace App\Entity;
  4.  
  5. use Serializable;
  6. use Cocur\Slugify\Slugify;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use JMS\Serializer\Annotation as Serializer;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. use Symfony\Component\Security\Core\User\UserInterface;
  13. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  14. use JMS\Serializer\Annotation\MaxDepth as MaxDepth;
  15.  
  16. /**
  17.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  18.  * @ORM\HasLifecycleCallbacks()
  19.  * @UniqueEntity(
  20.  *  fields = {"email"},
  21.  *  message = "Cette adresse email a déjà été utilisée."
  22.  * )
  23.  * @Serializer\ExclusionPolicy("all")
  24.  */
  25. class User implements UserInterface
  26. {
  27.     /**
  28.      * @ORM\Id()
  29.      * @ORM\GeneratedValue()
  30.      * @ORM\Column(type="integer")
  31.      * @Serializer\Expose
  32.      */
  33.     private $id;
  34.  
  35.     /**
  36.      * Adresse email de l'utilisateur
  37.      * @ORM\Column(type="string", length=180, unique=true)
  38.      * @Assert\NotBlank()
  39.      * @Assert\Email(message="Veuillez renseigner un email valide")
  40.      * @Serializer\Expose
  41.      */
  42.     private $email;
  43.  
  44.     /**
  45.      * Mot de passe de l'utilisateur
  46.      * @var string The hashed password
  47.      * @ORM\Column(type="string")
  48.      * @Assert\Length(
  49.      *      min = 4,
  50.      *      minMessage = "Votre mot de passe doit contenir au moins {{limit}}",
  51.      * )
  52.      * @Serializer\Expose
  53.      */
  54.     private $password;
  55.  
  56.     */ [...] */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top