-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangePasswordEntity.php
More file actions
61 lines (52 loc) · 1.2 KB
/
ChangePasswordEntity.php
File metadata and controls
61 lines (52 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* Created by PhpStorm.
* User: jwong
* Date: 3/15/16
* Time: 2:46 PM
*/
namespace Dayspring\LoginBundle\Entity;
use Symfony\Component\Security\Core\Validator\Constraints as SecurityAssert;
use Symfony\Component\Validator\Constraints as Assert;
class ChangePasswordEntity
{
protected $password;
protected $newPassword;
/**
* @return mixed
*/
#[SecurityAssert\UserPassword(
message: 'Wrong value for your current password'
)]
public function getPassword()
{
return $this->password;
}
/**
* @param mixed $password
*/
public function setPassword($password)
{
$this->password = $password;
}
/**
* @Assert\Length(
* min = 8,
* max = 50,
* minMessage = "Your password must be at least {{ limit }} characters long.",
* maxMessage = "Your password must be no longer than {{ limit }} characters."
* )
* @return mixed
*/
public function getNewPassword()
{
return $this->newPassword;
}
/**
* @param mixed $newPassword
*/
public function setNewPassword($newPassword)
{
$this->newPassword = $newPassword;
}
}