mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
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>
28 lines
531 B
PHP
28 lines
531 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 NodeDeletedEvent extends Event {
|
|
public function __construct(
|
|
readonly private Node $source,
|
|
) {
|
|
parent::__construct();
|
|
}
|
|
|
|
public function getSource(): Node {
|
|
return $this->source;
|
|
}
|
|
}
|