aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/api/share20ocs.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-01-27 20:51:26 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-01-28 07:54:09 +0100
commit34e912ab6b7b95660bbbdf7cec4074b272ce5d1a (patch)
treedb87885f8cd928913f50070c2b13307052359327 /apps/files_sharing/api/share20ocs.php
parentf2e70441e42a17b27248b93a05b0008717b124b1 (diff)
downloadnextcloud-server-34e912ab6b7b95660bbbdf7cec4074b272ce5d1a.tar.gz
nextcloud-server-34e912ab6b7b95660bbbdf7cec4074b272ce5d1a.zip
[Share 2.0] Fix interfaces and comments
* Made comments more clear * Removed unneeded methods * IShares shareTime is now a proper DateTime object * IShares getPath -> getNode & setPath -> setNode * Fix unit tests
Diffstat (limited to 'apps/files_sharing/api/share20ocs.php')
-rw-r--r--apps/files_sharing/api/share20ocs.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php
index 8e216c8c3c8..8d481d817ea 100644
--- a/apps/files_sharing/api/share20ocs.php
+++ b/apps/files_sharing/api/share20ocs.php
@@ -81,26 +81,26 @@ class Share20OCS {
'uid_owner' => $share->getSharedBy()->getUID(),
'displayname_owner' => $share->getSharedBy()->getDisplayName(),
'permissions' => $share->getPermissions(),
- 'stime' => $share->getShareTime(),
- 'parent' => $share->getParent(),
+ 'stime' => $share->getShareTime()->getTimestamp(),
+ 'parent' => null,
'expiration' => null,
'token' => null,
'uid_file_owner' => $share->getShareOwner()->getUID(),
'displayname_file_owner' => $share->getShareOwner()->getDisplayName(),
];
- $path = $share->getPath();
- $result['path'] = $this->rootFolder->getUserFolder($share->getShareOwner()->getUID())->getRelativePath($path->getPath());
- if ($path instanceOf \OCP\Files\Folder) {
+ $node = $share->getNode();
+ $result['path'] = $this->rootFolder->getUserFolder($share->getShareOwner()->getUID())->getRelativePath($node->getPath());
+ if ($node instanceOf \OCP\Files\Folder) {
$result['item_type'] = 'folder';
} else {
$result['item_type'] = 'file';
}
- $result['storage_id'] = $path->getStorage()->getId();
- $result['storage'] = $path->getStorage()->getCache()->getNumericStorageId();
- $result['item_source'] = $path->getId();
- $result['file_source'] = $path->getId();
- $result['file_parent'] = $path->getParent()->getId();
+ $result['storage_id'] = $node->getStorage()->getId();
+ $result['storage'] = $node->getStorage()->getCache()->getNumericStorageId();
+ $result['item_source'] = $node->getId();
+ $result['file_source'] = $node->getId();
+ $result['file_parent'] = $node->getParent()->getId();
$result['file_target'] = $share->getTarget();
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
@@ -220,7 +220,7 @@ class Share20OCS {
return new \OC_OCS_Result(null, 404, 'wrong path, file/folder doesn\'t exist');
}
- $share->setPath($path);
+ $share->setNode($path);
// Parse permissions (if available)
$permissions = $this->request->getParam('permissions', null);