aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Share20/DefaultShareProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Share20/DefaultShareProvider.php')
-rw-r--r--lib/private/Share20/DefaultShareProvider.php61
1 files changed, 30 insertions, 31 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index af993b7f314..2ad926fbaa7 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -226,7 +226,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->set('note', $qb->createNamedParameter($share->getNote()))
->set('accepted', $qb->createNamedParameter($share->getStatus()))
->set('reminder_sent', $qb->createNamedParameter($share->getReminderSent(), IQueryBuilder::PARAM_BOOL))
- ->execute();
+ ->executeStatement();
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
$qb = $this->dbConn->getQueryBuilder();
$qb->update('share')
@@ -239,7 +239,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->set('file_source', $qb->createNamedParameter($share->getNode()->getId()))
->set('expiration', $qb->createNamedParameter($expirationDate, IQueryBuilder::PARAM_DATE))
->set('note', $qb->createNamedParameter($share->getNote()))
- ->execute();
+ ->executeStatement();
/*
* Update all user defined group shares
@@ -254,7 +254,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->set('file_source', $qb->createNamedParameter($share->getNode()->getId()))
->set('expiration', $qb->createNamedParameter($expirationDate, IQueryBuilder::PARAM_DATE))
->set('note', $qb->createNamedParameter($share->getNote()))
- ->execute();
+ ->executeStatement();
/*
* Now update the permissions for all children that have not set it to 0
@@ -265,7 +265,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->andWhere($qb->expr()->neq('permissions', $qb->createNamedParameter(0)))
->set('permissions', $qb->createNamedParameter($share->getPermissions()))
->set('attributes', $qb->createNamedParameter($shareAttributes))
- ->execute();
+ ->executeStatement();
} elseif ($share->getShareType() === IShare::TYPE_LINK) {
$qb = $this->dbConn->getQueryBuilder();
$qb->update('share')
@@ -283,7 +283,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->set('note', $qb->createNamedParameter($share->getNote()))
->set('label', $qb->createNamedParameter($share->getLabel()))
->set('hide_download', $qb->createNamedParameter($share->getHideDownload() ? 1 : 0), IQueryBuilder::PARAM_INT)
- ->execute();
+ ->executeStatement();
}
if ($originalShare->getNote() !== $share->getNote() && $share->getNote() !== '') {
@@ -326,7 +326,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
- ->execute();
+ ->executeQuery();
$data = $stmt->fetch();
$stmt->closeCursor();
@@ -354,7 +354,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->update('share')
->set('accepted', $qb->createNamedParameter(IShare::STATUS_ACCEPTED))
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)))
- ->execute();
+ ->executeStatement();
return $share;
}
@@ -389,7 +389,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
))
->orderBy('id');
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
$children[] = $this->createShare($data);
}
@@ -416,7 +416,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->orWhere($qb->expr()->eq('parent', $qb->createNamedParameter($share->getId())));
}
- $qb->execute();
+ $qb->executeStatement();
}
/**
@@ -453,7 +453,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
- ->execute();
+ ->executeQuery();
$data = $stmt->fetch();
@@ -475,7 +475,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->update('share')
->set('permissions', $qb->createNamedParameter(0))
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)))
- ->execute();
+ ->executeStatement();
}
} elseif ($share->getShareType() === IShare::TYPE_USER) {
if ($share->getSharedWith() !== $recipient) {
@@ -506,7 +506,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
'file_target' => $qb->createNamedParameter($share->getTarget()),
'permissions' => $qb->createNamedParameter($share->getPermissions()),
'stime' => $qb->createNamedParameter($share->getShareTime()->getTimestamp()),
- ])->execute();
+ ])->executeStatement();
return $qb->getLastInsertId();
}
@@ -524,7 +524,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->where(
$qb->expr()->eq('id', $qb->createNamedParameter($share->getId()))
);
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$data = $cursor->fetch();
$cursor->closeCursor();
@@ -541,7 +541,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('share_with', $qb->createNamedParameter($recipient))
);
- $qb->execute();
+ $qb->executeStatement();
return $this->getShareById($share->getId(), $recipient);
}
@@ -556,7 +556,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->update('share')
->set('file_target', $qb->createNamedParameter($share->getTarget()))
->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())))
- ->execute();
+ ->executeStatement();
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
// Check if there is a usergroup share
$qb = $this->dbConn->getQueryBuilder();
@@ -570,7 +570,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
->setMaxResults(1)
- ->execute();
+ ->executeQuery();
$data = $stmt->fetch();
$stmt->closeCursor();
@@ -596,14 +596,14 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
'permissions' => $qb->createNamedParameter($share->getPermissions()),
'attributes' => $qb->createNamedParameter($shareAttributes),
'stime' => $qb->createNamedParameter($share->getShareTime()->getTimestamp()),
- ])->execute();
+ ])->executeStatement();
} else {
// Already a usergroup share. Update it.
$qb = $this->dbConn->getQueryBuilder();
$qb->update('share')
->set('file_target', $qb->createNamedParameter($share->getTarget()))
->where($qb->expr()->eq('id', $qb->createNamedParameter($data['id'])))
- ->execute();
+ ->executeStatement();
}
}
@@ -727,7 +727,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->setFirstResult($offset);
$qb->orderBy('id');
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$shares = [];
while ($data = $cursor->fetch()) {
$shares[] = $this->createShare($data);
@@ -761,7 +761,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
));
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$data = $cursor->fetch();
$cursor->closeCursor();
@@ -805,7 +805,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
- ->execute();
+ ->executeQuery();
$shares = [];
while ($data = $cursor->fetch()) {
@@ -882,7 +882,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId())));
}
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
if ($data['fileid'] && $data['path'] === null) {
@@ -933,7 +933,6 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId())));
}
-
$groups = array_filter($groups);
$qb->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_GROUP)))
@@ -946,7 +945,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
));
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
if ($offset > 0) {
$offset--;
@@ -1099,7 +1098,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$query->andWhere($qb->expr()->eq('parent', $qb->createNamedParameter($share->getId())));
}
- $stmt = $query->execute();
+ $stmt = $query->executeQuery();
while ($data = $stmt->fetch()) {
if (array_key_exists($data['parent'], $shareMap)) {
@@ -1179,7 +1178,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
return;
}
- $qb->execute();
+ $qb->executeStatement();
}
/**
@@ -1198,7 +1197,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->where($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_GROUP)))
->andWhere($qb->expr()->eq('share_with', $qb->createNamedParameter($gid)));
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$ids = [];
while ($row = $cursor->fetch()) {
$ids[] = (int)$row['id'];
@@ -1215,7 +1214,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
foreach ($chunks as $chunk) {
$qb->setParameter('parents', $chunk, IQueryBuilder::PARAM_INT_ARRAY);
- $qb->execute();
+ $qb->executeStatement();
}
}
@@ -1226,7 +1225,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->delete('share')
->where($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_GROUP)))
->andWhere($qb->expr()->eq('share_with', $qb->createNamedParameter($gid)));
- $qb->execute();
+ $qb->executeStatement();
}
/**
@@ -1342,7 +1341,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
));
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$users = [];
$link = false;
@@ -1659,7 +1658,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
)
);
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
try {
$share = $this->createShare($data);