private function getUserShareObjectIds() { $sharedObjectIds = array(); foreach (SharingTable::getList(array('select' => array('REAL_OBJECT_ID', 'TO_ENTITY', 'FROM_ENTITY'), 'filter' => array(array('LOGIC' => 'OR', '=TO_ENTITY' => Sharing::CODE_USER . $this->getUser()->getId(), '=FROM_ENTITY' => Sharing::CODE_USER . $this->getUser()->getId()), '!=STATUS' => SharingTable::STATUS_IS_DECLINED, 'REAL_STORAGE_ID' => $this->folder->getStorageId())))->fetchAll() as $row) { $sharedObjectIds[$row['REAL_OBJECT_ID']] = $row; } unset($row); return $sharedObjectIds; }
/** * Runs index by folder. * @param Folder $folder Target folder. * @throws \Bitrix\Main\LoaderException * @return void */ public function indexFolder(Folder $folder) { if (!Loader::includeModule('search')) { return; } //here we place configuration by Module (Options). Example, we can deactivate index for big files in Disk. if (!Configuration::allowIndexFiles()) { return; } $storage = $folder->getStorage(); if (!$storage) { return; } if (!$storage->getProxyType()->canIndexBySearch()) { return; } $searchData = array('LAST_MODIFIED' => $folder->getUpdateTime() ?: $folder->getCreateTime(), 'TITLE' => $folder->getName(), 'PARAM1' => $folder->getStorageId(), 'PARAM2' => $folder->getParentId(), 'SITE_ID' => $storage->getSiteId() ?: SITE_ID, 'URL' => $this->getDetailUrl($folder), 'PERMISSIONS' => $this->getSimpleRights($folder), 'BODY' => $this->getFolderContent($folder)); if ($storage->getProxyType() instanceof Group) { $searchData['PARAMS'] = array('socnet_group' => $storage->getEntityId(), 'entity' => 'socnet_group'); } /** @noinspection PhpDynamicAsStaticMethodCallInspection */ CSearch::index(Driver::INTERNAL_MODULE_ID, $this->getItemId($folder), $searchData, true); }