public function save(Pment_Models_Plog $plog) { $data = array( 'plogId' => $plog->getPlogId(), 'projectId' => $plog->getProjectId(), 'logDate' => $plog->getLogDate(), 'weatherAm' => $plog->getWeatherAm(), 'weatherPm' => $plog->getWeatherPm(), 'tempHi' => $plog->getTempHi(), 'tempLo' => $plog->getTempLo(), 'part' => $plog->getPart(), 'number' => $plog->getNumber(), 'operator' => $plog->getOperator(), 'foreman' => $plog->getForeman(), 'safety' => $plog->getSafety(), 'problem' => $plog->getProblem(), 'resolve' => $plog->getResolve(), 'relatedFile' => $plog->getRelatedFile(), 'changeSig' => $plog->getChangeSig(), 'material' => $plog->getMaterial(), 'contactId' => $plog->getContactId(), 'remark' => $plog->getRemark() ); if (null === ($id = $plog->getPlogId())) { unset($data['plogId']); $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('plogId = ?' => $plog->getPlogId())); } }