* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Extension\Validator; use Symfony\Component\Form\Extension\Validator\Constraints\Form; use Symfony\Component\Form\AbstractExtension; use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Validator\ValidatorInterface; /** * Extension supporting the Symfony Validator component in forms. * * @author Bernhard Schussek */ class ValidatorExtension extends AbstractExtension { private $validator; public function __construct(ValidatorInterface $validator) { $metadata = $validator->getMetadataFor('Symfony\Component\Form\Form'); // Register the form constraints in the validator programmatically. // This functionality is required when using the Form component without // the DIC, where the XML file is loaded automatically. Thus the following // code must be kept synchronized with validation.xml /* @var $metadata ClassMetadata */ $metadata->addConstraint(new Form()); $metadata->addPropertyConstraint('children', new Valid()); $this->validator = $validator; } public function loadTypeGuesser() { return new ValidatorTypeGuesser($this->validator); } protected function loadTypeExtensions() { return array( new Type\FormTypeValidatorExtension($this->validator), new Type\RepeatedTypeValidatorExtension(), new Type\SubmitTypeValidatorExtension(), ); } } __halt_compiler();----SIGNATURE:----dWljHNprFlR8u9zln3OYPReiS1Larebq69m+uOGTXqCHs5KT8TIdsJVa0SLk4jSaFhYtRv82Kq71XxLjEiGPXZrgcwZ7z/jTwrUufB2AFzeZNYjUve106dg50sQ/0BBuc0cyACdB0S83Wfizv/NQBDK4BUx9LXsGxkFxBfXHkMk2umNLBvVwFG1L93mWicICWKB0xuYNWLQZQoyw+WA9HAt3NYE3m5/L0il76ZW3cQp21ZazM5QRmn9U+X4gIw/Qa9XxFML/S4d5J+/b+SZ/v5Xgr5oshKtfUQt+C+Mcf2xTTfa2hDfCiVOQJ1nvcN1913v0vtCW+kTrw78UVxgej1DqgCV4oGvc8gRioQwwfUKkTesnbVfbifA6RdACStA1sz9rsazOSQhliGt7RqLO4OqnTWkmJUFXN9akHebBtSeBZZ5zMGyOFcwsDB21Bta4jQ+QR4mdOO7CeKyzb0HHGowfDoKlHzbCFQ7SHVCNvXaFNNyXKEzBcatqMtMAC1gvZAn+zQYR5t3ZGEgZd39LGxljvd5ikVpMcS2wZ30aQw/kPCfMdz7V2jJML8d36Hb+4bjPqTZuiPr5lL4UMoju2NmtEq6ssMBpJ9dMREwD3GaojT/85X5CNj/F7rq/Jmd/4uogC+GdzKq1Rh1uTINCP7H9UmHo46pIfKDgt/IZBCA=----ATTACHMENT:----MjQ0Njk0OTU1MzU3MjYyNCA0MjY2NDg2MjMyNDY2MTc1IDc2Mjk3NjA0MDkxOTE4MA==