. * */ namespace OCA\Documents; class Storage { public static function getDocuments() { $list = array_filter( \OCP\Files::searchByMime('application/vnd.oasis.opendocument.text'), function($item){ //filter Deleted if (strpos($item['path'], '_trashbin')===0){ return false; } return true; } ); return $list; } /** * @brief Cleanup session data on removing the document * @param array * * This function is connected to the delete signal of OC_Filesystem * to delete the related info from database */ public static function onDelete($params) { $info = \OC\Files\Filesystem::getFileInfo($params['path']); $fileId = @$info['fileid']; if (!$fileId){ return; } $sessionObj = new Db_Session(); $session = $sessionObj ->loadBy('file_id', $fileId) ->getData() ; if (!is_array($session) || !isset($session['es_id'])){ return; } Db_Session::cleanUp($session['es_id']); } }