nextcloud/apps/files_trashbin/lib/Events/BeforeNodeDeletedEvent.php
Carl Schwan ac029d1839 refactor(trash): Port deletion code of Trashbin to node based API
Instead of using a mix of View and Node based file system manipulation,
use the 'new' node based API everywhere.

Replace the hooks used in the admin_audit related to the deletion to new
typed event that expose the deleted nodes.

And remove old calculateSize to get the size of the deleted folder and
instead rely on the Node::getSize information.

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 16:07:16 +02:00

28 lines
537 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Files_Trashbin\Events;
use OCP\EventDispatcher\Event;
use OCP\Files\Node;
/**
* Event send before a node is deleted definitively.
* @since 32.0.0
*/
class BeforeNodeDeletedEvent extends Event {
public function __construct(
private readonly Node $source,
) {
parent::__construct();
}
public function getSource(): Node {
return $this->source;
}
}