<?php
namespace App\Entity;
use App\Repository\PasswordUpdateRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=PasswordUpdateRepository::class)
*/
class PasswordUpdate
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(
* max = 255,
* maxMessage = "{{ limit }} caractères maximum"
* )
*/
private $oldPassword;
/**
* @ORM\Column(type="string", length=255)
* @Assert\Length(min=8, minMessage="Votre mot de passe doit contenir au moins 8 caractères")
*/
private $newPassword;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\EqualTo(propertyPath="newPassword", message="Vous n'avez pas correctement confirmé votre nouveau mot de passe !")
*/
private $confirmPassword;
public function getId(): ?int
{
return $this->id;
}
public function getOldPassword(): ?string
{
return $this->oldPassword;
}
public function setOldPassword(string $oldPassword): self
{
$this->oldPassword = $oldPassword;
return $this;
}
public function getNewPassword(): ?string
{
return $this->newPassword;
}
public function setNewPassword(string $newPassword): self
{
$this->newPassword = $newPassword;
return $this;
}
public function getConfirmPassword(): ?string
{
return $this->confirmPassword;
}
public function setConfirmPassword(string $confirmPassword): self
{
$this->confirmPassword = $confirmPassword;
return $this;
}
}