Skip to content
Snippets Groups Projects
Commit e7bed5dd authored by Robin Appelman's avatar Robin Appelman
Browse files

allow creating Cache objects with only the storage id instead of the whole storage object

parent 706bb3cc
Branches
No related tags found
No related merge requests found
......@@ -19,24 +19,25 @@ class Cache {
const SHALLOW = 2; //folder in cache, but not all child files are completely scanned
const COMPLETE = 3;
/**
* @var \OC\Files\Storage\Storage
*/
private $storage;
/**
* @var array partial data for the cache
*/
private $partial = array();
/**
* @var string
*/
private $storageId;
/**
* @param \OC\Files\Storage\Storage $storage
* @param \OC\Files\Storage\Storage|string $storage
*/
public function __construct(\OC\Files\Storage\Storage $storage) {
$this->storage = $storage;
public function __construct($storage) {
if($storage instanceof \OC\Files\Storage\Storage){
$this->storageId = $storage->getId();
}else{
$this->storageId = $storage;
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment