Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace My\UserBundle\Validator;
- use Symfony\Component\Validator\Constraint;
- class Unique extends Constraint
- {
- public $message = 'The value for "%property%" already exists.';
- public $property;
- public function defaultOption()
- {
- return 'property';
- }
- public function requiredOptions()
- {
- return array('property');
- }
- public function validatedBy()
- {
- return 'my_user.validator.unique';
- }
- public function getTargets()
- {
- return self::CLASS_CONSTRAINT;
- }
- }
Add Comment
Please, Sign In to add comment