diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-04 12:51:23 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-04 12:51:23 +0100 |
commit | fc215d0980ec3cfa21ac64119bcec614cc1323bb (patch) | |
tree | 4b4aac5a83f642f35404fc1be7a593d58d77e8c8 /lib/private/share20/defaultshareprovider.php | |
parent | cd16ba5cb3bf9333b0ecacab4bf152c1b692ed59 (diff) | |
download | nextcloud-server-fc215d0980ec3cfa21ac64119bcec614cc1323bb.tar.gz nextcloud-server-fc215d0980ec3cfa21ac64119bcec614cc1323bb.zip |
Make the share object lazy
Share providers can now just pass in a fileId. And the node will only be
created once needed.
Diffstat (limited to 'lib/private/share20/defaultshareprovider.php')
-rw-r--r-- | lib/private/share20/defaultshareprovider.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/private/share20/defaultshareprovider.php b/lib/private/share20/defaultshareprovider.php index 38d1dae316d..48164a5d419 100644 --- a/lib/private/share20/defaultshareprovider.php +++ b/lib/private/share20/defaultshareprovider.php @@ -711,7 +711,7 @@ class DefaultShareProvider implements IShareProvider { * @throws InvalidShare */ private function createShare($data) { - $share = new Share(); + $share = new Share($this->rootFolder); $share->setId((int)$data['id']) ->setShareType((int)$data['share_type']) ->setPermissions((int)$data['permissions']) @@ -744,8 +744,7 @@ class DefaultShareProvider implements IShareProvider { $share->setShareOwner($data['uid_owner']); } - $path = $this->getNode($share->getShareOwner(), (int)$data['file_source']); - $share->setNode($path); + $share->setNodeId((int)$data['file_source']); if ($data['expiration'] !== null) { $expiration = \DateTime::createFromFormat('Y-m-d H:i:s', $data['expiration']); |