当前位置: 首页>>代码示例>>PHP>>正文


PHP CSocNetFeatures::getById方法代码示例

本文整理汇总了PHP中CSocNetFeatures::getById方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetFeatures::getById方法的具体用法?PHP CSocNetFeatures::getById怎么用?PHP CSocNetFeatures::getById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSocNetFeatures的用法示例。


在下文中一共展示了CSocNetFeatures::getById方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: OnSocNetFeaturesUpdate

 public static function OnSocNetFeaturesUpdate($id, $fields)
 {
     static $updateGroupFilesFeatures = false;
     if (!$updateGroupFilesFeatures && isset($fields['ACTIVE']) && $fields['ACTIVE'] == 'N') {
         $features = CSocNetFeatures::getById($id);
         if ($features && isset($features['FEATURE']) && $features['FEATURE'] == 'files' && $features['ENTITY_TYPE'] == 'G' && $features['ENTITY_ID']) {
             $updateGroupFilesFeatures = true;
             $groupId = $features['ENTITY_ID'];
             if (!empty($groupId)) {
                 $dispatcher = new \Bitrix\Webdav\InviteDispatcher();
                 $attachObjectType = CWebDavSymlinkHelper::ENTITY_TYPE_GROUP;
                 $attachObjectId = (int) $groupId;
                 $inviteComponentParams = array('attachObject' => array('id' => $attachObjectId, 'type' => $attachObjectType), 'unshareUserIds' => array());
                 $response = $dispatcher->processActionUnshare($inviteComponentParams);
                 if ($response['status'] == $dispatcher::STATUS_SUCCESS) {
                 }
             }
         }
     } elseif (isset($fields['ACTIVE']) && $fields['ACTIVE'] == 'Y') {
         $features = CSocNetFeatures::getById($id);
         if ($features && isset($features['FEATURE']) && $features['FEATURE'] == 'files' && $features['ENTITY_TYPE'] == 'G' && $features['ENTITY_ID']) {
             $groupId = $features['ENTITY_ID'];
             //add section to files in this group!
             $groupSectionCreateSuccess = (bool) self::groupSectionCreate($groupId);
         }
     }
     CIBlockWebdavSocnet::ClearTagCache('wd_socnet');
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:28,代码来源:iblocksocnet.php

示例2: onSocNetFeaturesUpdate

 public static function onSocNetFeaturesUpdate($id, $fields)
 {
     static $updateGroupFilesFeatures = false;
     if (!$updateGroupFilesFeatures && isset($fields['ACTIVE']) && $fields['ACTIVE'] == 'N') {
         /** @noinspection PhpDynamicAsStaticMethodCallInspection */
         $features = \CSocNetFeatures::getById($id);
         if ($features && isset($features['FEATURE']) && $features['FEATURE'] == 'files' && $features['ENTITY_TYPE'] == 'G' && $features['ENTITY_ID']) {
             $updateGroupFilesFeatures = true;
             $groupId = $features['ENTITY_ID'];
             if (empty($groupId)) {
                 return;
             }
             $storage = Driver::getInstance()->getStorageByGroupId($groupId);
             if (!$storage) {
                 return;
             }
             $userId = self::getActivityUserId();
             foreach (Sharing::getModelList(array('filter' => array('REAL_OBJECT_ID' => (int) $storage->getRootObjectId(), 'REAL_STORAGE_ID' => (int) $storage->getId()))) as $sharing) {
                 $sharing->delete($userId);
             }
             unset($sharing);
         }
     } elseif (isset($fields['ACTIVE']) && $fields['ACTIVE'] == 'Y') {
         /** @noinspection PhpDynamicAsStaticMethodCallInspection */
         $features = \CSocNetFeatures::getById($id);
         if ($features && isset($features['FEATURE']) && $features['FEATURE'] == 'files' && $features['ENTITY_TYPE'] == 'G' && $features['ENTITY_ID']) {
             $groupId = $features['ENTITY_ID'];
             if (!empty($groupId)) {
                 Driver::getInstance()->addGroupStorage($groupId);
             }
         }
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:33,代码来源:socialnetworkhandlers.php


注:本文中的CSocNetFeatures::getById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。