public function process($data) { if ($this->isValid($data) !== true) { throw new C3op_Form_OutlayCreateException('Invalid data!'); } else { $db = Zend_Registry::get('db'); $outlayMapper = new C3op_Projects_OutlayMapper($db); $outlay = new C3op_Projects_Outlay($this->humanResource->GetValue()); $outlay->SetAction($this->action->GetValue()); $outlay->SetProject($this->project->GetValue()); $outlay->SetPredictedValue($this->predictedValue->GetValue()); $predictedDate = $this->predictedDate->GetValue(); $dateValidator = new C3op_Util_ValidDate(); if ($dateValidator->isValid($predictedDate)) { $converter = new C3op_Util_DateConverter(); $dateForMysql = $converter->convertDateToMySQLFormat($predictedDate); $outlay->SetPredictedDate($dateForMysql); } $outlay->SetObservation($this->observation->GetValue()); $outlayMapper->insert($outlay); } }