Added Plain Password Attribute

This commit is contained in:
Kevin Frantz 2018-09-12 19:57:40 +02:00
parent 2e3cd98640
commit dffea5d3b9
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace App\Entity\Attribut;
use Symfony\Component\Validator\Constraints as Assert;
/**
*
* @author kevinfrantz
*
*/
trait PlainPasswordAttribute {
/**
*
* @Assert\NotBlank()
* @Assert\Length(max=4096)
*/
private $plainPassword;
public function getPlainPassword(): ?string
{
return $this->plainPassword;
}
public function setPlainPassword($password): void
{
$this->plainPassword = $password;
}
}

View File

@ -4,6 +4,7 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Attribut\UsernameAttribut;
use App\Entity\Attribut\PasswordAttribut;
use App\Entity\Attribut\PlainPasswordAttribute;
/**
*
@ -13,7 +14,7 @@ use App\Entity\Attribut\PasswordAttribut;
*/
class User extends AbstractSource implements UserInterface
{
use UsernameAttribut,PasswordAttribut;
use UsernameAttribut,PasswordAttribut,PlainPasswordAttribute;
/**
* @ORM\Column(name="is_active", type="boolean")