$stmt = $this->db->prepare('DELETE FROM `*PREFIX*calendarchanges` WHERE `calendarid` = ?');
$stmt->execute([$calendarId]);
+
+ $this->sharingBackend->deleteAllShares($calendarId);
}
/**
->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)))
$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