All pastes #345925 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-08 22:52 UTC
rendered paste body
 try
      {
        $this->form->validate();
        $center = $this->form->populateRecord('Center', $center);
        $center->save();
      }
      catch (gmForms_Validator_Exception $e)
      {
        $invalid_fields = $e->getInvalidFields();
        
        foreach ($invalid_fields as $f)
        {
          $this->getRequest()->setError($field->name(), $field->error());
        }
      }
      catch (Doctrine_Validator_Exception $e)
      {
        $invalid_records = $e->getInvalidRecords();
        
        foreach ($invalid_records as $r)
        {
          foreach ($r->getErrorStack() as $field_name => $error_code)
          {
            
          }
        }
      }