@@ -340,6 +340,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription | |||
$stmt = $this->db->prepare('DELETE FROM `*PREFIX*calendarchanges` WHERE `calendarid` = ?'); | |||
$stmt->execute([$calendarId]); | |||
$this->sharingBackend->deleteAllShares($calendarId); | |||
} | |||
/** |
@@ -336,10 +336,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { | |||
->setParameter('id', $addressBookId) | |||
->execute(); | |||
$query->delete('dav_shares') | |||
->where($query->expr()->eq('resourceid', $query->createNamedParameter($addressBookId))) | |||
->andWhere($query->expr()->eq('type', $query->createNamedParameter('addressbook'))) | |||
->execute(); | |||
$this->sharingBackend->deleteAllShares($addressBookId); | |||
$query->delete($this->dbCardsPropertiesTable) | |||
->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId))) |
@@ -96,6 +96,17 @@ class Backend { | |||
$query->execute(); | |||
} | |||
/** | |||
* @param $resourceId | |||
*/ | |||
public function deleteAllShares($resourceId) { | |||
$query = $this->db->getQueryBuilder(); | |||
$query->delete('dav_shares') | |||
->where($query->expr()->eq('resourceid', $query->createNamedParameter($resourceId))) | |||
->andWhere($query->expr()->eq('type', $query->createNamedParameter($this->resourceType))) | |||
->execute(); | |||
} | |||
/** | |||
* @param IShareable $shareable | |||
* @param string $element |