public function processDeleteAction() { $personId = (int) $this->_getParam("personId"); $type = $this->_getParam("type"); $id = (int) $this->_getParam("id"); $obj = null; switch ($type) { case 'address': $obj = new Address(); break; case 'phone': $obj = new PhoneNumber(); break; case 'note': $obj = new PatientNote(); break; default: break; } $retVal = false; if ($obj !== null && $id > 0) { foreach ($obj->_primaryKeys as $k) { $obj->{$k} = $id; } $obj->setPersistMode(WebVista_Model_ORM::DELETE); $obj->persist(); $retVal = true; } if ($retVal) { $data = true; } else { $data = array('error' => __('There was an error attempting to delete the selected record.')); } $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json'); $json->suppressExit = true; $json->direct($data); }
public function processDeleteAction() { $id = (int) $this->_getParam('id'); $orm = $this->_getParam('orm'); $obj = null; switch ($orm) { case 'patientNote': $obj = new PatientNote(); $obj->patientNoteId = $id; break; } $ret = false; if ($obj !== null) { $obj->setPersistMode(WebVista_Model_ORM::DELETE); $obj->persist(); $ret = true; } $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json'); $json->suppressExit = true; $json->direct($ret); }