public function isFormValid ($form, $throws=false)
    {
        if (!$form->isValid()) {
            if ($throws) {
                throw new ValidationException("Data validation failure");
            }
            return false;
        } else {
            return true;
        }
    }
public function isFormValid ($form, $throws=false)
    {
        if (!$form->isValid()) {
            if ($throws) {
                throw new ValidationException("Data validation failure");
            }
            return false;
        } else {
            return true;
        }
    }
public function isFormValid ( $ form , $ throws = false ) { if ( ! $ form -> isValid ( ) ) { if ( $ throws ) { throw new ValidationException ( "Data validation failure" ) ; } return false ; } else { return true ; } }
Validate form with embedded data - is it valid?

In reality this method should be called by controller. If it fails, false is returned.
When called from createFromForm(), it throws exception.

@param    Form with bound data to validate
@param    Validation failure throws exception? (mostly used by createFromForm() method for final checkup)
@return   bool
Validate form with embedded data - is it valid?