]> source.dussan.org Git - nextcloud-server.git/commitdiff
[Share 2.0] Fix IShare
authorRoeland Jago Douma <rullzer@owncloud.com>
Wed, 27 Jan 2016 10:50:49 +0000 (11:50 +0100)
committerRoeland Jago Douma <rullzer@owncloud.com>
Wed, 27 Jan 2016 21:04:09 +0000 (22:04 +0100)
lib/private/share20/defaultshareprovider.php
lib/private/share20/ishare.php
lib/private/share20/share.php
tests/lib/share20/defaultshareprovidertest.php

index 117d56acf9344df9752fb8775c57fd623359086f..36ba56d63a25a2145e6b7eae84013bfee6330a8e 100644 (file)
@@ -356,7 +356,7 @@ class DefaultShareProvider implements IShareProvider {
                                                'file_source' => $qb->createNamedParameter($share->getPath()->getId()),
                                                'file_target' => $qb->createNamedParameter($share->getTarget()),
                                                'permissions' => $qb->createNamedParameter(0),
-                                               'stime' => $qb->createNamedParameter($share->getSharetime()),
+                                               'stime' => $qb->createNamedParameter($share->getShareTime()),
                                        ])->execute();
 
                        } else if ($data['permissions'] !== 0) {
index 34d1dfa4d3d632c0bb4a9c301d87f289de2fc2d0..d3ffd417fe0a994628322d1a7d6c45cbbaf8b4ae 100644 (file)
@@ -217,12 +217,28 @@ interface IShare {
         */
        public function getTarget();
 
+       /**
+        * Set the time this share was created
+        *
+        * @param int $shareTime
+        * @return IShare The modified object
+        */
+       public function setShareTime($shareTime);
+
        /**
         * Get the timestamp this share was created
         *
         * @return int
         */
-       public function getSharetime();
+       public function getShareTime();
+
+       /**
+        * Set mailSend
+        *
+        * @param bool $mailSend
+        * @return IShare The modified object
+        */
+       public function setMailSend($mailSend);
 
        /**
         * Get mailSend
index ee43725d9bcacf7ee1b0f3e9f0d45538d806d946..3e42d5084763371770310fc0e885b93eb2b8886a 100644 (file)
@@ -58,10 +58,7 @@ class Share implements IShare {
        private $mailSend;
 
        /**
-        * Set the id of the share
-        *
-        * @param string $id
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setId($id) {
                $this->id = $id;
@@ -69,9 +66,7 @@ class Share implements IShare {
        }
 
        /**
-        * Get the id of the share
-        *
-        * @return string
+        * @inheritdoc
         */
        public function getId() {
                return $this->id;
@@ -93,10 +88,7 @@ class Share implements IShare {
        }
 
        /**
-        * Set the path of this share
-        *
-        * @param Node $path
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setPath(Node $path) {
                $this->path = $path;
@@ -104,19 +96,14 @@ class Share implements IShare {
        }
 
        /**
-        * Get the path of this share for the current user
-        * 
-        * @return Node
+        * @inheritdoc
         */
        public function getPath() {
                return $this->path;
        }
 
        /**
-        * Set the shareType
-        *
-        * @param int $shareType
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setShareType($shareType) {
                $this->shareType = $shareType;
@@ -124,19 +111,14 @@ class Share implements IShare {
        }
 
        /**
-        * Get the shareType 
-        *
-        * @return int
+        * @inheritdoc
         */
        public function getShareType() {
                return $this->shareType;
        }
 
        /**
-        * Set the receiver of this share
-        *
-        * @param IUser|IGroup|string
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setSharedWith($sharedWith) {
                $this->sharedWith = $sharedWith;
@@ -144,19 +126,14 @@ class Share implements IShare {
        }
 
        /**
-        * Get the receiver of this share
-        *
-        * @return IUser|IGroup|string
+        * @inheritdoc
         */
        public function getSharedWith() {
                return $this->sharedWith;
        }
 
        /**
-        * Set the permissions
-        *
-        * @param int $permissions
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setPermissions($permissions) {
                //TODO checkes
@@ -166,19 +143,14 @@ class Share implements IShare {
        }
 
        /**
-        * Get the share permissions
-        *
-        * @return int
+        * @inheritdoc
         */
        public function getPermissions() {
                return $this->permissions;
        }
 
        /**
-        * Set the expiration date
-        *
-        * @param \DateTime $expireDate
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setExpirationDate($expireDate) {
                //TODO checks
@@ -188,19 +160,14 @@ class Share implements IShare {
        }
 
        /**
-        * Get the share expiration date
-        *
-        * @return \DateTime
+        * @inheritdoc
         */
        public function getExpirationDate() {
                return $this->expireDate;
        }
 
        /**
-        * Set the sharer of the path
-        *
-        * @param IUser|string $sharedBy
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setSharedBy($sharedBy) {
                //TODO checks
@@ -210,9 +177,7 @@ class Share implements IShare {
        }
 
        /**
-        * Get share sharer
-        *
-        * @return IUser|string
+        * @inheritdoc
         */
        public function getSharedBy() {
                //TODO check if set
@@ -220,11 +185,7 @@ class Share implements IShare {
        }
 
        /**
-        * Set the original share owner (who owns the path)
-        *
-        * @param IUser|string
-        *
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setShareOwner($shareOwner) {
                //TODO checks
@@ -234,9 +195,7 @@ class Share implements IShare {
        }
 
        /**
-        * Get the original share owner (who owns the path)
-        * 
-        * @return IUser|string
+        * @inheritdoc
         */
        public function getShareOwner() {
                //TODO check if set
@@ -244,33 +203,22 @@ class Share implements IShare {
        }
 
        /**
-        * Set the password
-        *
-        * @param string $password
-        *
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setPassword($password) {
-               //TODO verify
-
                $this->password = $password;
                return $this;
        }
 
        /**
-        * Get the password
-        *
-        * @return string
+        * @inheritdoc
         */
        public function getPassword() {
                return $this->password;
        }
 
        /**
-        * Set the token
-        *
-        * @param string $token
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setToken($token) {
                $this->token = $token;
@@ -278,19 +226,14 @@ class Share implements IShare {
        }
 
        /**
-        * Get the token
-        *
-        * @return string
+        * @inheritdoc
         */
        public function getToken() {
                return $this->token;
        }
 
        /**
-        * Set the parent id of this share
-        *
-        * @param int $parent
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setParent($parent) {
                $this->parent = $parent;
@@ -298,19 +241,14 @@ class Share implements IShare {
        }
 
        /**
-        * Get the parent id of this share
-        *
-        * @return int
+        * @inheritdoc
         */
        public function getParent() {
                return $this->parent;
        }
 
        /**
-        * Set the target of this share
-        *
-        * @param string $target
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setTarget($target) {
                $this->target = $target;
@@ -318,19 +256,14 @@ class Share implements IShare {
        }
 
        /**
-        * Get the target of this share
-        *
-        * @return string
+        * @inheritdoc
         */
        public function getTarget() {
                return $this->target;
        }
 
        /**
-        * Set the time this share was created
-        *
-        * @param int $shareTime
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setShareTime($shareTime) {
                $this->shareTime = $shareTime;
@@ -338,19 +271,14 @@ class Share implements IShare {
        }
 
        /**
-        * Get the timestamp this share was created
-        *
-        * @return int
+        * @inheritdoc
         */
-       public function getSharetime() {
+       public function getShareTime() {
                return $this->shareTime;
        }
 
        /**
-        * Set mailSend
-        *
-        * @param bool $mailSend
-        * @return IShare The modified object
+        * @inheritdoc
         */
        public function setMailSend($mailSend) {
                $this->mailSend = $mailSend;
@@ -358,9 +286,7 @@ class Share implements IShare {
        }
 
        /**
-        * Get mailSend
-        *
-        * @return bool
+        * @inheritdoc
         */
        public function getMailSend() {
                return $this->mailSend;
index f86d4df948d62f13e4127107f560aabf959b376f..2bbcdfa04892fbcbfc2703cfe6546e2dbb749a5f 100644 (file)
@@ -596,7 +596,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
                $this->assertSame($shareOwner, $share2->getShareOwner());
                $this->assertSame(1, $share2->getPermissions());
                $this->assertSame('/target', $share2->getTarget());
-               $this->assertLessThanOrEqual(time(), $share2->getSharetime());
+               $this->assertLessThanOrEqual(time(), $share2->getShareTime());
                $this->assertSame($path, $share2->getPath());
        }
 
@@ -659,7 +659,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
                $this->assertSame($shareOwner, $share2->getShareOwner());
                $this->assertSame(1, $share2->getPermissions());
                $this->assertSame('/target', $share2->getTarget());
-               $this->assertLessThanOrEqual(time(), $share2->getSharetime());
+               $this->assertLessThanOrEqual(time(), $share2->getShareTime());
                $this->assertSame($path, $share2->getPath());
        }
 
@@ -718,7 +718,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
                $this->assertSame($shareOwner, $share2->getShareOwner());
                $this->assertSame(1, $share2->getPermissions());
                $this->assertSame('/target', $share2->getTarget());
-               $this->assertLessThanOrEqual(time(), $share2->getSharetime());
+               $this->assertLessThanOrEqual(time(), $share2->getShareTime());
                $this->assertSame($path, $share2->getPath());
                $this->assertSame('password', $share2->getPassword());
                $this->assertSame('token', $share2->getToken());