Ejemplo n.º 1
0
 public function ContactDismiss(C3op_Projects_Action $action, C3op_Projects_HumanResource $humanResource, C3op_Projects_HumanResourceMapper $humanResourceMapper)
 {
     if ($humanResource->GetContact() > 0) {
         $humanResource->SetContact(0);
         $humanResourceMapper->update($humanResource);
         $this->LogDismiss($action);
     }
 }
Ejemplo n.º 2
0
 public function process($data)
 {
     if ($this->isValid($data) !== true) {
         throw new C3op_Form_HumanResourceCreateException('Invalid data!');
     } else {
         $db = Zend_Registry::get('db');
         $humanResourceMapper = new C3op_Projects_HumanResourceMapper($db);
         $humanResource = new C3op_Projects_HumanResource();
         $humanResource->SetDescription($this->description->GetValue());
         $humanResource->SetContact($this->contact->GetValue());
         $humanResource->SetValue($this->value->GetValue());
         $humanResource->SetAction($this->action->GetValue());
         $humanResourceMapper->insert($humanResource);
         return $humanResource->GetId();
     }
 }