public function save(Pment_Models_Record $record) { $data = array( 'recId' => $record->getrecId(), 'projectId' => $record->getProjectId(), 'recDate' => $record->getRecDate(), 'recUnit' => $record->getRecUnit(), 'content' =>$record->getContent(), 'recNumber' => $record->getrecNumber(), 'contactId' => $record->getContactId(), 'remark' => $record->getRemark() ); if (null === ($id = $record->getRecId())) { unset($data['recId']); $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('recId = ?' => $record->getRecId())); } }