remove unused code

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2020-01-31 15:56:52 +01:00 committed by Roeland Jago Douma
parent e178718e74
commit 95cd44c41e
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 0 additions and 53 deletions

View File

@ -27,7 +27,6 @@
namespace OCA\DAV\DAV;
use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Connector\Sabre\Node;
use OCP\IDBConnection;
use OCP\IUser;
@ -319,56 +318,4 @@ class CustomPropertiesBackend implements BackendInterface {
return true;
}
/**
* Bulk load properties for directory children
*
* @param Directory $node
* @param array $requestedProperties requested properties
*
* @return void
*/
private function loadChildrenProperties(Directory $node, $requestedProperties) {
$path = $node->getPath();
if (isset($this->cache[$path])) {
// we already loaded them at some point
return;
}
$childNodes = $node->getChildren();
// pre-fill cache
foreach ($childNodes as $childNode) {
$this->cache[$childNode->getPath()] = [];
}
$sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` LIKE ?';
$sql .= ' AND `propertyname` in (?) ORDER BY `propertypath`, `propertyname`';
$result = $this->connection->executeQuery(
$sql,
array($this->user->getUID(), $this->connection->escapeLikeParameter(rtrim($path, '/')) . '/%', $requestedProperties),
array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
);
$oldPath = null;
$props = [];
while ($row = $result->fetch()) {
$path = $row['propertypath'];
if ($oldPath !== $path) {
// save previously gathered props
$this->cache[$oldPath] = $props;
$oldPath = $path;
// prepare props for next path
$props = [];
}
$props[$row['propertyname']] = $row['propertyvalue'];
}
if (!is_null($oldPath)) {
// save props from last run
$this->cache[$oldPath] = $props;
}
$result->closeCursor();
}
}