本文整理汇总了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');
}
示例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);
}
}
}
}