public function process($data) { if ($this->isValid($data) !== true) { throw new C3op_Form_ProjectCreateException('Invalid data!'); } else { $db = Zend_Registry::get('db'); $projectMapper = new C3op_Projects_ProjectMapper($db); $project = new C3op_Projects_Project(); $project->SetTitle($this->title->GetValue()); $project->SetClient($this->client->GetValue()); $project->SetOurResponsible($this->ourResponsible->GetValue()); $project->SetResponsibleAtClient($this->responsibleAtClient->GetValue()); $beginDate = $this->beginDate->GetValue(); $dateValidator = new C3op_Util_ValidDate(); if ($dateValidator->isValid($beginDate)) { $converter = new C3op_Util_DateConverter(); $dateForMysql = $converter->convertDateToMySQLFormat($beginDate); $project->SetBeginDate($dateForMysql); } $finishDate = $this->finishDate->GetValue(); $dateValidator = new C3op_Util_ValidDate(); if ($dateValidator->isValid($finishDate)) { $converter = new C3op_Util_DateConverter(); $dateForMysql = $converter->convertDateToMySQLFormat($finishDate); $project->SetFinishDate($dateForMysql); } $project->SetValue($this->value->GetValue()); $project->SetStatus($this->status->GetValue()); $project->SetContractNature($this->contractNature->GetValue()); $project->SetAreaActivity($this->areaActivity->GetValue()); $project->SetOverhead($this->overhead->GetValue()); $project->SetManagementFee($this->managementFee->GetValue()); $project->SetObject($this->object->GetValue()); $project->SetSummary($this->summary->GetValue()); $project->SetObservation($this->observation->GetValue()); $projectMapper->insert($project); } }