/** * Return a complete SystemRecord * * @param string $strSystemid * @return mixed */ public function getSystemRecord($strSystemid = "") { if ($strSystemid == "") { $strSystemid = $this->getSystemid(); } $strQuery = "SELECT * FROM " . _dbprefix_ . "system\n LEFT JOIN " . _dbprefix_ . "system_right\n ON system_id = right_id\n LEFT JOIN " . _dbprefix_ . "system_date\n ON system_id = system_date_id\n WHERE system_id = ?"; return $this->objDB->getPRow($strQuery, array($strSystemid)); }
/** * Looks up the rights for a given SystemID and going up the tree if needed (inheritance!) * * @param string $strSystemid * * @return array */ private function getPlainRightRow($strSystemid) { if (class_orm_rowcache::getCachedInitRow($strSystemid) != null && array_key_exists("right_id", class_orm_rowcache::getCachedInitRow($strSystemid))) { $arrRow = class_orm_rowcache::getCachedInitRow($strSystemid); } else { $strQuery = "SELECT *\r\n FROM " . _dbprefix_ . "system,\r\n " . _dbprefix_ . "system_right\r\n WHERE system_id = ?\r\n AND right_id = system_id "; $arrRow = $this->objDb->getPRow($strQuery, array($strSystemid)); } $arrRights = array(); if (isset($arrRow["right_id"])) { $arrRights[self::$STR_RIGHT_VIEW] = $arrRow["right_view"]; $arrRights[self::$STR_RIGHT_EDIT] = $arrRow["right_edit"]; $arrRights[self::$STR_RIGHT_DELETE] = $arrRow["right_delete"]; $arrRights[self::$STR_RIGHT_RIGHT] = $arrRow["right_right"]; $arrRights[self::$STR_RIGHT_RIGHT1] = $arrRow["right_right1"]; $arrRights[self::$STR_RIGHT_RIGHT2] = $arrRow["right_right2"]; $arrRights[self::$STR_RIGHT_RIGHT3] = $arrRow["right_right3"]; $arrRights[self::$STR_RIGHT_RIGHT4] = $arrRow["right_right4"]; $arrRights[self::$STR_RIGHT_RIGHT5] = $arrRow["right_right5"]; $arrRights[self::$STR_RIGHT_CHANGELOG] = isset($arrRow["right_changelog"]) ? $arrRow["right_changelog"] : ""; $arrRights[self::$STR_RIGHT_INHERIT] = (int) $arrRow["right_inherit"]; $arrRights["system_prev_id"] = $arrRow["system_prev_id"]; $arrRights["system_id"] = $arrRow["system_id"]; } else { $arrRights[self::$STR_RIGHT_VIEW] = ""; $arrRights[self::$STR_RIGHT_EDIT] = ""; $arrRights[self::$STR_RIGHT_DELETE] = ""; $arrRights[self::$STR_RIGHT_RIGHT] = ""; $arrRights[self::$STR_RIGHT_RIGHT1] = ""; $arrRights[self::$STR_RIGHT_RIGHT2] = ""; $arrRights[self::$STR_RIGHT_RIGHT3] = ""; $arrRights[self::$STR_RIGHT_RIGHT4] = ""; $arrRights[self::$STR_RIGHT_RIGHT5] = ""; $arrRights[self::$STR_RIGHT_CHANGELOG] = ""; $arrRights[self::$STR_RIGHT_INHERIT] = 1; $arrRights["system_prev_id"] = ""; $arrRights["system_id"] = ""; } return $arrRights; }
/** * Get the class name for a system-id. * * @param string $strSystemid * @return string */ public function getClassNameForId($strSystemid) { $strClass = ""; if (isset($this->arrClassCache[$strSystemid])) { $strClass = $this->arrClassCache[$strSystemid]; } else { //maybe the orm handler has already fetched this row $arrCacheRow = class_orm_rowcache::getCachedInitRow($strSystemid); if ($arrCacheRow != null && isset($arrCacheRow["system_class"])) { $strClass = $arrCacheRow["system_class"]; } else { $strQuery = "SELECT * FROM " . _dbprefix_ . "system where system_id = ?"; $arrRow = $this->objDB->getPRow($strQuery, array($strSystemid)); if (isset($arrRow["system_class"])) { $strClass = $arrRow["system_class"]; } } if ($strClass != "") { $this->arrClassCache[$strSystemid] = $strClass; $this->bitCacheSaveRequired = true; } } return $strClass; }
/** * @return mixed */ private function getTopQueriesCount() { $strQuery = "SELECT COUNT(DISTINCT(search_log_query)) as total\n\t\t\t\t\t FROM " . _dbprefix_ . "search_log\n\t\t\t\t\t WHERE search_log_date > ?\n\t\t\t\t\t AND search_log_date <= ?"; $arrReturn = $this->objDB->getPRow($strQuery, array($this->intDateStart, $this->intDateEnd)); return $arrReturn["total"]; }
private function getValueOfSetting($strName) { $strValue = $this->objDB->getPRow("SELECT * FROM " . _dbprefix_ . "system_config WHERE system_config_name = ? ", array($strName)); $strValue = $strValue["system_config_value"]; return $strValue; }