| @@ 23-66 (lines=44) @@ | ||
| 20 | * |
|
| 21 | * @author Ivannis Suárez Jerez <[email protected]> |
|
| 22 | */ |
|
| 23 | class LoginUserMessage implements MessageInterface |
|
| 24 | { |
|
| 25 | /** |
|
| 26 | * @var string |
|
| 27 | */ |
|
| 28 | protected $email; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * LoginUserMessage constructor. |
|
| 32 | * |
|
| 33 | * @param $email |
|
| 34 | */ |
|
| 35 | public function __construct($email) |
|
| 36 | { |
|
| 37 | $this->setEmail($email); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @return string |
|
| 42 | */ |
|
| 43 | public function email() |
|
| 44 | { |
|
| 45 | return $this->email; |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * @param string $email |
|
| 50 | */ |
|
| 51 | public function setEmail($email) |
|
| 52 | { |
|
| 53 | $this->email = $email; |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * {@inheritdoc} |
|
| 58 | */ |
|
| 59 | public static function loadValidatorMetadata(ClassMetadata $classMetadata) |
|
| 60 | { |
|
| 61 | $classMetadata->addPropertyConstraint( |
|
| 62 | 'email', |
|
| 63 | Assert::email() |
|
| 64 | ); |
|
| 65 | } |
|
| 66 | } |
|
| 67 | ||
| @@ 23-66 (lines=44) @@ | ||
| 20 | * |
|
| 21 | * @author Ivannis Suárez Jerez <[email protected]> |
|
| 22 | */ |
|
| 23 | class RemoveUserMessage implements MessageInterface |
|
| 24 | { |
|
| 25 | /** |
|
| 26 | * @var string |
|
| 27 | */ |
|
| 28 | protected $email; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * RemoveUserMessage constructor. |
|
| 32 | * |
|
| 33 | * @param $email |
|
| 34 | */ |
|
| 35 | public function __construct($email) |
|
| 36 | { |
|
| 37 | $this->setEmail($email); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @return string |
|
| 42 | */ |
|
| 43 | public function email() |
|
| 44 | { |
|
| 45 | return $this->email; |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * @param string $email |
|
| 50 | */ |
|
| 51 | public function setEmail($email) |
|
| 52 | { |
|
| 53 | $this->email = $email; |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * {@inheritdoc} |
|
| 58 | */ |
|
| 59 | public static function loadValidatorMetadata(ClassMetadata $classMetadata) |
|
| 60 | { |
|
| 61 | $classMetadata->addPropertyConstraint( |
|
| 62 | 'email', |
|
| 63 | Assert::email() |
|
| 64 | ); |
|
| 65 | } |
|
| 66 | } |
|
| 67 | ||