protected function validate($obj)
    {
        $errors = $this->container->get('validator')->validate($obj);

        if (count($errors) > 0) {
            throw new ValidationException($errors);
        }
    }
protected function validate($obj)
    {
        $errors = $this->container->get('validator')->validate($obj);

        if (count($errors) > 0) {
            throw new ValidationException($errors);
        }
    }
protected function validate ( $ obj ) { $ errors = $ this -> container -> get ( 'validator' ) -> validate ( $ obj ) ; if ( count ( $ errors ) > 0 ) { throw new ValidationException ( $ errors ) ; } }
Convenience validation method that will automatically throw custom ValidationExceptions
when validation fails.

@throws ValidationException
Convenience validation method that will automatically throw custom ValidationExceptions when validation fails .