validation: { enabled: true, enable_annotations: false }
Bundle\Entity\Post:
properties:
name:
- NotBlank: ~
text:
- NotBlank: ~
$entity = new Entity();
$validator = $this->get('validator');
$errors = $validator->validate($entity);
if (count($errors)>0) {
} else {
}
1456916553