|
3
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of the FOSUserBundle package. |
|
|
5 |
* |
|
|
6 |
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> |
|
|
7 |
* |
|
|
8 |
* For the full copyright and license information, please view the LICENSE |
|
|
9 |
* file that was distributed with this source code. |
|
|
10 |
*/ |
|
|
11 |
|
|
|
12 |
namespace FOS\UserBundle\Validator; |
|
|
13 |
|
|
|
14 |
use Symfony\Component\Validator\Constraint; |
|
|
15 |
|
|
|
16 |
/** |
|
|
17 |
* @Annotation |
|
|
18 |
*/ |
|
|
19 |
class Password extends Constraint |
|
|
20 |
{ |
|
|
21 |
public $message = 'The entered password is invalid.'; |
|
|
22 |
public $passwordProperty; |
|
|
23 |
public $userProperty; |
|
|
24 |
|
|
|
25 |
public function requiredOptions() |
|
|
26 |
{ |
|
|
27 |
return array('passwordProperty'); |
|
|
28 |
} |
|
|
29 |
|
|
|
30 |
public function validatedBy() |
|
|
31 |
{ |
|
|
32 |
return 'fos_user.validator.password'; |
|
|
33 |
} |
|
|
34 |
|
|
|
35 |
/** |
|
|
36 |
* {@inheritDoc} |
|
|
37 |
*/ |
|
|
38 |
public function getTargets() |
|
|
39 |
{ |
|
|
40 |
return self::CLASS_CONSTRAINT; |
|
|
41 |
} |
|
|
42 |
} |