|
@@ 225-235 (lines=11) @@
|
| 222 |
|
* @param int $numericStorageId |
| 223 |
|
* @return CachedMountInfo[] |
| 224 |
|
*/ |
| 225 |
|
public function getMountsForStorageId($numericStorageId) { |
| 226 |
|
$builder = $this->connection->getQueryBuilder(); |
| 227 |
|
$query = $builder->select('storage_id', 'root_id', 'user_id', 'mount_point', 'mount_id', 'f.path') |
| 228 |
|
->from('mounts', 'm') |
| 229 |
|
->innerJoin('m', 'filecache', 'f' , $builder->expr()->eq('m.root_id', 'f.fileid')) |
| 230 |
|
->where($builder->expr()->eq('storage_id', $builder->createPositionalParameter($numericStorageId, IQueryBuilder::PARAM_INT))); |
| 231 |
|
|
| 232 |
|
$rows = $query->execute()->fetchAll(); |
| 233 |
|
|
| 234 |
|
return array_filter(array_map([$this, 'dbRowToMountInfo'], $rows)); |
| 235 |
|
} |
| 236 |
|
|
| 237 |
|
/** |
| 238 |
|
* @param int $rootFileId |
|
@@ 241-251 (lines=11) @@
|
| 238 |
|
* @param int $rootFileId |
| 239 |
|
* @return CachedMountInfo[] |
| 240 |
|
*/ |
| 241 |
|
public function getMountsForRootId($rootFileId) { |
| 242 |
|
$builder = $this->connection->getQueryBuilder(); |
| 243 |
|
$query = $builder->select('storage_id', 'root_id', 'user_id', 'mount_point', 'mount_id', 'f.path') |
| 244 |
|
->from('mounts', 'm') |
| 245 |
|
->innerJoin('m', 'filecache', 'f', $builder->expr()->eq('m.root_id', 'f.fileid')) |
| 246 |
|
->where($builder->expr()->eq('root_id', $builder->createPositionalParameter($rootFileId, IQueryBuilder::PARAM_INT))); |
| 247 |
|
|
| 248 |
|
$rows = $query->execute()->fetchAll(); |
| 249 |
|
|
| 250 |
|
return array_filter(array_map([$this, 'dbRowToMountInfo'], $rows)); |
| 251 |
|
} |
| 252 |
|
|
| 253 |
|
/** |
| 254 |
|
* @param $fileId |