本文整理汇总了PHP中CGroup::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP CGroup::getList方法的具体用法?PHP CGroup::getList怎么用?PHP CGroup::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGroup
的用法示例。
在下文中一共展示了CGroup::getList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllowableUserGroups
public static function getAllowableUserGroups($documentType)
{
$storageId = self::getStorageIdByType($documentType);
if (!$storageId) {
throw new CBPArgumentNullException('documentType');
}
/** @var Storage $storage */
$storage = Storage::loadById($storageId, array('ROOT_OBJECT'));
if (!$storage) {
throw new CBPArgumentNullException('documentType');
}
if ($storage->getProxyType() instanceof ProxyType\Group) {
if (Loader::includeModule("socialnetwork")) {
$resultUserGroups = array();
$resultUserGroups["author"] = Loc::getMessage("DISK_USER_GROUPS_AUTHOR");
$resultUserGroups[SONET_ROLES_OWNER] = Loc::getMessage("DISK_USER_GROUPS_OWNER");
$resultUserGroups[SONET_ROLES_MODERATOR] = Loc::getMessage("DISK_USER_GROUPS_MODS");
$resultUserGroups[SONET_ROLES_USER] = Loc::getMessage("DISK_USER_GROUPS_MEMBERS");
return $resultUserGroups;
}
} else {
$resultUserGroups = array('Author' => Loc::getMessage("DISK_USER_GROUPS_AUTHOR"));
$groupIds = array(1);
foreach (Driver::getInstance()->getRightsManager()->getSpecificRights($storage->getRootObject()) as $right) {
if (preg_match("/^G(\\d+)\$/", $right['ACCESS_CODE'], $match)) {
$groupIds[] = $match[1];
}
}
unset($right);
//Crutch for Bitrix24 context (user group management is not supported)
if (ModuleManager::isModuleInstalled('bitrix24')) {
$siteId = \CAllSite::getDefSite();
$employeeGroup = \CGroup::getList($by = '', $order = '', array('STRING_ID' => 'EMPLOYEES_' . $siteId, 'STRING_ID_EXACT_MATCH' => 'Y'))->fetch();
if ($employeeGroup) {
$employeeGroupId = (int) $employeeGroup['ID'];
if (!in_array($employeeGroupId, $groupIds, true)) {
$groupIds[] = $employeeGroupId;
}
}
}
$dbGroupsList = \CGroup::getListEx(array('NAME' => 'ASC'), array('ID' => $groupIds));
while ($group = $dbGroupsList->fetch()) {
$resultUserGroups[$group['ID']] = $group['NAME'];
}
return $resultUserGroups;
}
}
示例2: array
// sites
$slaSiteList = CTicketSLA::GetSiteArrayForAllSLA();
// groups
$slaGroupList = CTicketSLA::GetGroupArrayForAllSLA();
// groups info
$groupIds = array();
foreach ($slaGroupList as $slaId => $groups)
{
$groupIds = array_merge($groupIds, $groups);
}
$groupIds = array_unique($groupIds);
$slaGroupNames = array();
$res = CGroup::getList($by=null, $order=null, array('ID' => join('|', $groupIds)));
while ($arRes = $res->Fetch())
{
$slaGroupNames[$arRes['ID']] = $arRes['NAME'];
}
// users info
$slaResponsiblesInfo = array();
$slaResponsibles = array_unique($slaResponsibles);
if ($slaResponsibles)
{
$res = CUser::getList($by=null, $order=null, array('ID' => join('|', $slaResponsibles)));
while ($arRes = $res->Fetch())
{
$slaResponsiblesInfo[$arRes['ID']] = array(