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