2017-01-06 09:39:01 -05:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2026-02-09 04:53:58 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2017-01-06 09:39:01 -05:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-01-06 09:39:01 -05:00
|
|
|
*/
|
|
|
|
|
namespace OC\Files\Notify;
|
|
|
|
|
|
|
|
|
|
use OCP\Files\Notify\IChange;
|
|
|
|
|
|
|
|
|
|
class Change implements IChange {
|
|
|
|
|
/**
|
2025-11-20 12:02:21 -05:00
|
|
|
* @param IChange::ADDED|IChange::REMOVED|IChange::MODIFIED|IChange::RENAMED $type
|
2017-01-06 09:39:01 -05:00
|
|
|
*/
|
2025-11-17 09:32:54 -05:00
|
|
|
public function __construct(
|
2025-11-20 12:02:21 -05:00
|
|
|
private readonly int $type,
|
|
|
|
|
private readonly string $path,
|
2025-11-17 09:32:54 -05:00
|
|
|
) {
|
2017-01-06 09:39:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the type of the change
|
|
|
|
|
*
|
2025-11-20 12:02:21 -05:00
|
|
|
* @return IChange::ADDED|IChange::REMOVED|IChange::MODIFIED|IChange::RENAMED
|
2017-01-06 09:39:01 -05:00
|
|
|
*/
|
2025-11-20 12:02:21 -05:00
|
|
|
public function getType(): int {
|
2017-01-06 09:39:01 -05:00
|
|
|
return $this->type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the path of the file that was changed relative to the root of the storage
|
|
|
|
|
*
|
|
|
|
|
* Note, for rename changes this path is the old path for the file
|
|
|
|
|
*/
|
2025-11-20 12:02:21 -05:00
|
|
|
public function getPath(): string {
|
2017-01-06 09:39:01 -05:00
|
|
|
return $this->path;
|
|
|
|
|
}
|
|
|
|
|
}
|