You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function registerBackend(string $storageType, \OCA\Files_Trashbin\Trash\ITrashBackend $backend);
81
+
/**
82
+
* List all trash items in the root of the trashbin
83
+
*
84
+
* @return ITrashItem[]
85
+
* @since 15.0.0
86
+
*/
87
+
public function listTrashRoot(\OCP\IUser $user) : array;
88
+
/**
89
+
* Temporally prevent files from being moved to the trash
90
+
*
91
+
* @since 15.0.0
92
+
*/
31
93
public function pauseTrash();
32
-
94
+
/**
95
+
* @since 15.0.0
96
+
*/
33
97
public function resumeTrash();
34
98
}
35
-
36
-
interface ITrashBackend {
99
+
/**
100
+
* @since 15.0.0
101
+
*/
102
+
interface ITrashItem extends \OCP\Files\FileInfo
103
+
{
37
104
/**
38
-
* @return ITrashItem[]
39
-
*/
40
-
public function listTrashRoot(IUser $user): array;
41
-
105
+
* Get the trash backend for this item
106
+
*
107
+
* @since 15.0.0
108
+
*/
109
+
public function getTrashBackend() : \OCA\Files_Trashbin\Trash\ITrashBackend;
42
110
/**
43
-
* @return ITrashItem[]
44
-
*/
45
-
public function listTrashFolder(ITrashItem $folder): array;
46
-
111
+
* Get the original location for the trash item
112
+
*
113
+
* @since 15.0.0
114
+
*/
115
+
public function getOriginalLocation() : string;
47
116
/**
48
-
* @param ITrashItem $item
49
-
*/
50
-
public function restoreItem(ITrashItem $item);
51
-
52
-
public function removeItem(ITrashItem $item);
53
-
54
-
public function moveToTrash(IStorage $storage, string $internalPath): bool;
55
-
117
+
* Get the timestamp that the file was moved to trash
118
+
*
119
+
* @since 15.0.0
120
+
*/
121
+
public function getDeletedTime() : int;
56
122
/**
57
-
* @return Node|null
58
-
*/
59
-
public function getTrashNodeById(IUser $user, int $fileId);
60
-
}
61
-
62
-
interface ITrashItem extends FileInfo {
63
-
public function getTrashBackend(): ITrashBackend;
64
-
65
-
public function getOriginalLocation(): string;
66
-
67
-
public function getDeletedTime(): int;
68
-
69
-
public function getTrashPath(): string;
70
-
71
-
public function isRootItem(): bool;
72
-
73
-
public function getUser(): IUser;
74
-
75
-
public function getTitle(): string;
123
+
* Get the path of the item relative to the users trashbin
124
+
*
125
+
* @since 15.0.0
126
+
*/
127
+
public function getTrashPath() : string;
128
+
/**
129
+
* Whether the item is a deleted item in the root of the trash, or a file in a subfolder
130
+
*
131
+
* @since 15.0.0
132
+
*/
133
+
public function isRootItem() : bool;
134
+
/**
135
+
* Get the user for which this trash item applies
136
+
*
137
+
* @since 15.0.0
138
+
*/
139
+
public function getUser() : \OCP\IUser;
140
+
/**
141
+
* @since 30.0.0
142
+
*/
143
+
public function getDeletedBy() : ?\OCP\IUser;
144
+
public function getTitle() : string;
76
145
}
77
-
78
146
class TrashItem implements \OCA\Files_Trashbin\Trash\ITrashItem
79
147
{
80
-
/** @var ITrashBackend */
81
-
private $backend;
82
-
/** @var string */
83
-
private $orignalLocation;
84
-
/** @var int */
85
-
private $deletedTime;
86
-
/** @var string */
87
-
private $trashPath;
88
-
/** @var FileInfo */
89
-
private $fileInfo;
90
-
/** @var IUser */
91
-
private $user;
92
-
public function __construct(\OCA\Files_Trashbin\Trash\ITrashBackend $backend, string $originalLocation, int $deletedTime, string $trashPath, \OCP\Files\FileInfo $fileInfo, \OCP\IUser $user)
148
+
public function __construct(private \OCA\Files_Trashbin\Trash\ITrashBackend $backend, private string $originalLocation, private int $deletedTime, private string $trashPath, private \OCP\Files\FileInfo $fileInfo, private \OCP\IUser $user, private ?\OCP\IUser $deletedBy)
93
149
{
94
150
}
95
151
public function getTrashBackend() : \OCA\Files_Trashbin\Trash\ITrashBackend
0 commit comments