public function SaveWhenRejected(Gyuser_Model_Notifications $obj) { $opMapper = new Gyuser_Model_OperationsDataMapper(); $opObj = new Gyuser_Model_Operations(); $opObj->setId($obj->getOperator_id()); $opResult = $opMapper->GetStateByOperationId($opObj); if ($opResult) { $state_name = $opResult['state_name']; $state_change = $opResult['state_change']; $client_id = $opResult['client_id']; $obj->setClient_id($client_id); } $sessionNamespace = new Zend_Session_Namespace(); $operatorId = null; if ($sessionNamespace->loginAuth == true) { $authDetail = $sessionNamespace->authDetail; $operatorId = $authDetail->getId(); } $data = array('title' => $obj->getTitle(), 'comment' => $obj->getComment(), 'operator_id' => $operatorId, 'action_date' => $obj->getAction_date(), 'client_id' => $obj->getClient_id()); if (null === ($id = $obj->getId())) { unset($data['id']); $id = $this->getDbTable()->insert($data); return $id; } else { unset($data['operation_id']); $id = $this->getDbTable()->update($data, array('id = ?' => $id)); return $id; } }