public static function addAfterMove(BaseObject $object, array $subscribersLostAccess, $updatedBy, ErrorCollection $errorCollection) { $items = array(); $dateTime = new DateTime(); $isFolder = $object instanceof Folder; foreach ($subscribersLostAccess as $storageId => $userId) { $items[] = array('STORAGE_ID' => $storageId, 'OBJECT_ID' => $object->getId(), 'TYPE' => $isFolder ? ObjectTable::TYPE_FOLDER : ObjectTable::TYPE_FILE, 'USER_ID' => $updatedBy, 'CREATE_TIME' => $dateTime); } unset($storageId, $userId); DeletedLogTable::insertBatch($items); if ($isFolder) { Driver::getInstance()->cleanCacheTreeBitrixDisk(array_keys($subscribersLostAccess)); } Driver::getInstance()->sendChangeStatus($subscribersLostAccess); }
public function getVersionDelete($element) { if (empty($element) || !is_array($element)) { $this->errorCollection->add(array(new Error("Could not " . __METHOD__ . ", empty element", 11160))); return false; } $v = \Bitrix\Disk\Internals\DeletedLogTable::getList(array('filter' => array('STORAGE_ID' => $this->storage->getId(), 'OBJECT_ID' => $element['extra']['id']), 'order' => array('CREATE_TIME' => 'DESC')))->fetch(); if ($v) { return $v['CREATE_TIME']->getTimestamp(); } $this->errorCollection->add(array(new Error("Could not " . __METHOD__ . ", find deletedLog", 111601))); return false; }