src/Entity/PasswordUpdate.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PasswordUpdateRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass=PasswordUpdateRepository::class)
  8.  */
  9. class PasswordUpdate
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      * @Assert\Length(
  20.      *      max = 255,
  21.      *      maxMessage = "{{ limit }} caractères maximum"
  22.      * )
  23.      */
  24.     private $oldPassword;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      * @Assert\Length(min=8, minMessage="Votre mot de passe doit contenir au moins 8 caractères")
  28.      */
  29.     private $newPassword;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      * @Assert\EqualTo(propertyPath="newPassword", message="Vous n'avez pas correctement confirmé votre nouveau mot de passe !")
  33.      */
  34.     private $confirmPassword;
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getOldPassword(): ?string
  40.     {
  41.         return $this->oldPassword;
  42.     }
  43.     public function setOldPassword(string $oldPassword): self
  44.     {
  45.         $this->oldPassword $oldPassword;
  46.         return $this;
  47.     }
  48.     public function getNewPassword(): ?string
  49.     {
  50.         return $this->newPassword;
  51.     }
  52.     public function setNewPassword(string $newPassword): self
  53.     {
  54.         $this->newPassword $newPassword;
  55.         return $this;
  56.     }
  57.     public function getConfirmPassword(): ?string
  58.     {
  59.         return $this->confirmPassword;
  60.     }
  61.     public function setConfirmPassword(string $confirmPassword): self
  62.     {
  63.         $this->confirmPassword $confirmPassword;
  64.         return $this;
  65.     }
  66. }