2019-12-03 19:57:53 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-02-18 15:47:54 +01:00
|
|
|
/**
|
2024-05-23 09:26:56 +02:00
|
|
|
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2019-02-18 15:47:54 +01:00
|
|
|
*/
|
2021-02-15 14:03:08 +01:00
|
|
|
namespace OCP\Files\Cache;
|
2019-02-18 15:47:54 +01:00
|
|
|
|
2019-11-22 20:52:10 +01:00
|
|
|
use OCP\EventDispatcher\Event;
|
2019-02-18 15:47:54 +01:00
|
|
|
use OCP\Files\Storage\IStorage;
|
|
|
|
|
2021-02-15 14:03:08 +01:00
|
|
|
/**
|
|
|
|
* @since 22.0.0
|
|
|
|
*/
|
2019-02-18 15:47:54 +01:00
|
|
|
class AbstractCacheEvent extends Event implements ICacheEvent {
|
|
|
|
protected $storage;
|
|
|
|
protected $path;
|
|
|
|
protected $fileId;
|
2020-11-13 17:04:36 +01:00
|
|
|
protected $storageId;
|
2019-02-18 15:47:54 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param IStorage $storage
|
|
|
|
* @param string $path
|
|
|
|
* @param int $fileId
|
2021-02-15 14:03:08 +01:00
|
|
|
* @since 22.0.0
|
2019-02-18 15:47:54 +01:00
|
|
|
*/
|
2020-11-13 17:04:36 +01:00
|
|
|
public function __construct(IStorage $storage, string $path, int $fileId, int $storageId) {
|
2019-02-18 15:47:54 +01:00
|
|
|
$this->storage = $storage;
|
|
|
|
$this->path = $path;
|
|
|
|
$this->fileId = $fileId;
|
2020-11-13 17:04:36 +01:00
|
|
|
$this->storageId = $storageId;
|
2019-02-18 15:47:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return IStorage
|
2021-02-15 14:03:08 +01:00
|
|
|
* @since 22.0.0
|
2019-02-18 15:47:54 +01:00
|
|
|
*/
|
|
|
|
public function getStorage(): IStorage {
|
|
|
|
return $this->storage;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
2021-02-15 14:03:08 +01:00
|
|
|
* @since 22.0.0
|
2019-02-18 15:47:54 +01:00
|
|
|
*/
|
|
|
|
public function getPath(): string {
|
|
|
|
return $this->path;
|
|
|
|
}
|
|
|
|
|
2020-02-13 08:38:33 +01:00
|
|
|
/**
|
|
|
|
* @param string $path
|
2021-02-15 14:03:08 +01:00
|
|
|
* @since 22.0.0
|
2020-02-13 08:38:33 +01:00
|
|
|
*/
|
|
|
|
public function setPath(string $path): void {
|
|
|
|
$this->path = $path;
|
|
|
|
}
|
|
|
|
|
2019-02-18 15:47:54 +01:00
|
|
|
/**
|
|
|
|
* @return int
|
2021-02-15 14:03:08 +01:00
|
|
|
* @since 22.0.0
|
2019-02-18 15:47:54 +01:00
|
|
|
*/
|
|
|
|
public function getFileId(): int {
|
|
|
|
return $this->fileId;
|
|
|
|
}
|
2020-11-13 17:04:36 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return int
|
2021-02-15 14:03:08 +01:00
|
|
|
* @since 22.0.0
|
2020-11-13 17:04:36 +01:00
|
|
|
*/
|
|
|
|
public function getStorageId(): int {
|
|
|
|
return $this->storageId;
|
|
|
|
}
|
2019-02-18 15:47:54 +01:00
|
|
|
}
|