<?phptry{$user->name="this is an example of too long name";$user->Email->address="drink@@notvalid..";$user->save();}catch(Doctrine_Validator_Exception$e){$stack=$e->getErrorStack();foreach($stackas$component=>$err){foreach($erras$field=>$type){switch($type):caseDoctrine_Validator::ERR_TYPE:print$field." is not right type";break;caseDoctrine_Validator::ERR_UNIQUE:print$field." is not unique";break;caseDoctrine_Validator::ERR_VALID:print$field." is not valid";break;caseDoctrine_Validator::ERR_LENGTH:print$field." is too long";break;endswitch;}}}?>