summaryrefslogtreecommitdiffstats
path: root/lib/Service
diff options
context:
space:
mode:
authorAurélien <dav.aurelien@gmail.com>2021-01-28 13:54:08 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 22:31:21 +0200
commit5f69c256e30bdebf40264166e6dd29f12904e14e (patch)
tree51fa6e29273c83835ab77ace63ba42167e22b5ba /lib/Service
parentf3c4d744c011df8d18c49495f5111a17197b7038 (diff)
Add function for avoid duplicate item (share)
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'lib/Service')
-rw-r--r--lib/Service/ItemService.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Service/ItemService.php b/lib/Service/ItemService.php
index 6bb09e64c..7e0743324 100644
--- a/lib/Service/ItemService.php
+++ b/lib/Service/ItemService.php
@@ -372,4 +372,17 @@ class ItemService extends Service
{
return $this->itemMapper->sharedCount($userId);
}
+
+ /**
+ * Check if the article is already shared between the users
+ *
+ * @param string $itemId the id article
+ * @param string $userId the name of the user
+ * @param string $shareWithId the name of the second user
+ * @return int 0 if not exists or > 0
+ */
+ public function checkSharing($itemId, $shareWithId, $userId)
+ {
+ return $this->itemMapper->checkSharing($itemId, $shareWithId, $userId);
+ }
}