public function GetMenuByParentID($ParentID, $force = false) { $Cache = new CacheFile(); if (!$ParentID) { $ParentID = $this->TopID(); } $CacheID = '/Moudles/Menus/' . $ParentID; $result = $Cache->Get($CacheID); if ($result == CacheFile::NOCACHE || $force) { $DB = $this->__InitDB(); $sql = 'SELECT * FROM `' . $this->TableName . '` WHERE `' . $this->ParentID . '`=' . $ParentID . ' AND Property<2 ORDER BY `' . $this->GlobalDisplayOrder . '` ASC'; $result = $DB->Select($sql); if ($result) { $Cache->Save($CacheID, $result, CacheFile::__OneYearSeconds__); } } return $result; }
public function GetUserGroup($UserGroupID, $force = false) { $DB = new DB(); $Cache = new CacheFile(); $CacheID = '/Users/UserGroupID/' . $UserGroupID; $result = $Cache->Get($CacheID); if ($result == CacheFile::NOCACHE || $force) { $Sql = 'SELECT * FROM tbl_usergroups WHERE UserGroupID=' . $UserGroupID; $result = $DB->GetOne($Sql); if ($result) { $Cache->Save($CacheID, $result, CacheFile::__OneYearSeconds__); } } return $result; }