public static function claimLine($visitId, array $claimIds) { $db = Zend_Registry::get('dbAdapter'); $orm = new ClaimLine(); $orm->visitId = (int) $visitId; $table = $orm->_table; $sqlSelect = $db->select()->from($table)->where('claimId IN (' . implode(',', $claimIds) . ')')->where('visitId = ?', (int) $orm->visitId)->group('claimId')->limit(1); if ($row = $db->fetchRow($sqlSelect)) { $orm->populateWithArray($row); } return $orm; }
public function processEditClaimAction() { $params = $this->_getParam('claimLine'); $ret = false; if (is_array($params) && isset($params['claimLineId']) && $params['claimLineId'] > 0) { $claimLineId = (int) $params['claimLineId']; $claimLine = new ClaimLine(); $claimLine->claimLineId = $claimLineId; $claimLine->populate(); $claimLine->populateWithArray($params); $claimLine->persist(); $ret = $this->_generateClaimRow($claimLine); } $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json'); $json->suppressExit = true; $json->direct($ret); }