當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JAccess::userGroups方法代碼示例

本文整理匯總了PHP中JAccess::userGroups方法的典型用法代碼示例。如果您正苦於以下問題:PHP JAccess::userGroups方法的具體用法?PHP JAccess::userGroups怎麽用?PHP JAccess::userGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JAccess的用法示例。


在下文中一共展示了JAccess::userGroups方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getGroupPath

 /**
  * Gets the parent groups that a leaf group belongs to in its branch back to the root of the tree
  * (including the leaf group id).
  *
  * @param mixed $groupId An integer or array of integers representing the identities to check.
  *
  * @return mixed True if allowed, false for an explicit deny, null for an implicit deny.
  *
  * @since   11.1
  */
 protected static function getGroupPath($groupId)
 {
     // Preload all groups
     if (empty(self::$userGroups)) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true)->select('parent.id, parent.lft, parent.rgt')->from('#__usergroups AS parent')->order('parent.lft');
         $db->setQuery($query);
         self::$userGroups = $db->loadObjectList('id');
     }
     // Make sure groupId is valid
     if (!array_key_exists($groupId, self::$userGroups)) {
         return array();
     }
     // Get parent groups and leaf group
     if (!isset(self::$userGroupPaths[$groupId])) {
         self::$userGroupPaths[$groupId] = array();
         foreach (self::$userGroups as $group) {
             if ($group->lft <= self::$userGroups[$groupId]->lft && $group->rgt >= self::$userGroups[$groupId]->rgt) {
                 self::$userGroupPaths[$groupId][] = $group->id;
             }
         }
     }
     return self::$userGroupPaths[$groupId];
 }
開發者ID:houzhenggang,項目名稱:cobalt,代碼行數:34,代碼來源:access.php

示例2: clearStatics

 /**
  * Method for clearing static caches.
  *
  * @return  void
  *
  * @since   11.3
  */
 public static function clearStatics()
 {
     self::$componentsPreloaded = false;
     self::$viewLevels = array();
     self::$assetPermissionsById = array();
     self::$assetPermissionsByName = array();
     self::$preloadedAssetTypes = array();
     self::$identities = array();
     self::$assetRules = array();
     self::$userGroups = array();
     self::$userGroupPaths = array();
     self::$groupsByUser = array();
 }
開發者ID:eshiol,項目名稱:joomla-cms,代碼行數:20,代碼來源:access.php


注:本文中的JAccess::userGroups方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。