protected static function cache($categories, PermissionKeyCategory $pkc) { if (!is_array($categories)) { $categories = array(); } $categories[$pkc->getPermissionKeyCategoryID()] = $pkc; $categories[$pkc->getPermissionKeyCategoryHandle()] = $pkc; Cache::set('permission_key_categories', false, $categories); }
protected function populateCategories() { $db = Loader::db(); self::$categories = array(); $r = $db->Execute('select pkCategoryID, pkCategoryHandle, pkgID from PermissionKeyCategories'); while ($row = $r->FetchRow()) { $pkc = new PermissionKeyCategory(); $pkc->setPropertiesFromArray($row); self::$categories[$pkc->getPermissionKeyCategoryID()] = $pkc; self::$categories[$pkc->getPermissionKeyCategoryHandle()] = $pkc; } }