Created
May 6, 2012 09:36
-
-
Save coreymcmahon/2621255 to your computer and use it in GitHub Desktop.
Use a validator to validate an instance of an entity class - http://www.symfonycentral.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ... rest of the controller */ | |
$article = new Article(); | |
/* do stuff to the Article entity instance */ | |
$validator = $this->get('validator'); | |
$errors = $validator->validate($author); | |
/* rest of the controller... */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment