public static function fetchAll($where = null, $order = null, $limit = null, $offset = null)
 {
     $resultSet = self::getDbTable()->fetchAll($where, $order, $limit, $offset);
     $entries = array();
     foreach ($resultSet as $row) {
         $entry = new Application_Model_O_DepartmentsHospitalMap();
         $entry->setId($row->id)->setDepartment_id($row->department_id)->setHospital_id($row->hospital_id)->setSort($row->sort)->setCtime($row->ctime)->setUtime($row->utime)->setStatus($row->status);
         $entry->setNew(false);
         $entries[] = $entry;
     }
     return $entries;
 }
 public function hospitaladdajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     //var_dump($this->_getAllParams());exit;
     $did = $this->_getParam('did');
     $hid = $this->_getParam('hid');
     $map = new Application_Model_O_DepartmentsHospitalMap();
     //var_dump($map);exit;
     if ($did && $hid) {
         $map->setDepartment_id($did)->setHospital_id($hid)->setCtime(date('Y-m-d H:i:s'));
     }
     try {
         $out['errno'] = "0";
         $map->save();
     } catch (Zend_Db_Exception $e) {
         $out['errno'] = "1";
         $out['msg'] = $e->getMessage();
     }
     Yy_Utils::jsonOut($out);
 }