Skip to content

Commit

Permalink
Add some comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
redblom committed Nov 18, 2024
1 parent b4be7af commit 25cef18
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/Hooks/TrashbinHook.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

/**
* This class enhances the trashbin delete event with SURF trashbin related functionality.
*
*/

namespace OCA\SURFTrashbin\Hooks;

use Exception;
Expand Down Expand Up @@ -29,6 +34,12 @@ public function __construct(
$this->trashbinMapper = $trashbinMapper;
}

/**
* The method called when a node is permanently deleted.
*
* @param array $params ['path' => {path}]
* @return void
*/
public function permanentDelete(array $params): void
{
// get the filecache items and find out if we are dealing with an f_account item
Expand Down Expand Up @@ -63,13 +74,12 @@ public function permanentDelete(array $params): void

$fAccountView = new View("/$fAccountUID");
$fAccountView->unlink($fAccountFileCacheItem[FileCacheMapper::TABLE_COLUMN_PATH]);

if (isset($ownerOrUserFileCacheItem)) {
$ownerOrUserView = new View("/$ownerOrUserUserUID");
$ownerOrUserView->unlink($ownerOrUserFileCacheItem[FileCacheMapper::TABLE_COLUMN_PATH]);
}


// retrieve the trashbin items so we can delete them from the table
[$fileOrFoldername, $timestamp] = $this->trashbinService->getNameAndTimestamp($name);
$trashbinItems = $this->trashbinMapper->getItems($fileOrFoldername, $timestamp);
Expand Down

0 comments on commit 25cef18

Please sign in to comment.