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


PHP CIBlockSection::update方法代码示例

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


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

示例1: processActionShare

 public function processActionShare(array $params)
 {
     $this->params = $params;
     $attachSectionData = $this->getSectionDataByAttachObject($params['attachObject']);
     \CWebDavSymlinkHelper::setPathPattern('user', $params['pathToUser']);
     \CWebDavSymlinkHelper::setPathPattern('group', $params['pathToGroup']);
     $result = array();
     foreach ($params['attachToUserIds'] as $userIdToShare) {
         if ($userIdToShare == $params['inviteFromUserId']) {
             //to owner we don't create really symlink. Already there section.
             $result[] = array('userId' => $attachSectionData['SECTION_ID']);
             continue;
         }
         $targetSectionData = $this->getSectionDataByUserId($userIdToShare);
         $targetSectionData['IBLOCK_SECTION_ID'] = $targetSectionData['SECTION_ID'];
         $linkData = array('ID' => $attachSectionData['SECTION_ID'], 'IBLOCK_ID' => $attachSectionData['IBLOCK_ID'], 'NAME' => $this->generateNameForSymLinkSection($targetSectionData, $params['attachObject']), 'CREATED_BY' => $params['inviteFromUserId'], 'INVITE_USER_ID' => $userIdToShare, 'CAN_EDIT' => $params['canEdit'], 'CAN_FORWARD' => 0);
         $symlinkSectionId = \CWebDavSymlinkHelper::createSymLinkSection($targetSectionData, $linkData, $params['attachObject']['type']);
         if ($symlinkSectionId) {
             $result[] = array('userId' => $symlinkSectionId);
         }
     }
     if ($result) {
         \CWebDavDiskDispatcher::sendChangeStatus($params['inviteFromUserId'], 'share_section');
         global $DB;
         //update timestamp_x for incremental snapshot from disk.
         $section = new \CIBlockSection();
         $section->update($attachSectionData['SECTION_ID'], array('~TIMESTAMP_X' => $DB->getNowFunction()), false, false);
         return $this->sendJsonResponse(array('status' => self::STATUS_SUCCESS, 'sections' => $result));
     }
     return $this->sendJsonResponse(array('status' => self::STATUS_ERROR));
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:invitedispatcher.php


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