@@ -787,7 +787,7 @@ public function createCalendar($principalUri, $calendarUri, array $properties) {
787
787
$ calendarId = $ query ->getLastInsertId ();
788
788
789
789
$ calendarData = $ this ->getCalendarById ($ calendarId );
790
- $ this ->dispatcher ->dispatchTyped (new CalendarCreatedEvent ($ calendarId , $ calendarData ));
790
+ $ this ->dispatcher ->dispatchTyped (new CalendarCreatedEvent (( int ) $ calendarId , $ calendarData ));
791
791
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::createCalendar ' , new GenericEvent (
792
792
'\OCA\DAV\CalDAV\CalDavBackend::createCalendar ' ,
793
793
[
@@ -847,7 +847,7 @@ public function updateCalendar($calendarId, PropPatch $propPatch) {
847
847
848
848
$ calendarData = $ this ->getCalendarById ($ calendarId );
849
849
$ shares = $ this ->getShares ($ calendarId );
850
- $ this ->dispatcher ->dispatchTyped (new CalendarUpdatedEvent ($ calendarId , $ calendarData , $ shares , $ mutations ));
850
+ $ this ->dispatcher ->dispatchTyped (new CalendarUpdatedEvent (( int ) $ calendarId , $ calendarData , $ shares , $ mutations ));
851
851
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::updateCalendar ' , new GenericEvent (
852
852
'\OCA\DAV\CalDAV\CalDavBackend::updateCalendar ' ,
853
853
[
@@ -896,7 +896,9 @@ public function deleteCalendar($calendarId) {
896
896
->andWhere ($ query ->expr ()->eq ('calendartype ' , $ query ->createNamedParameter (self ::CALENDAR_TYPE_CALENDAR )))
897
897
->execute ();
898
898
899
- $ this ->dispatcher ->dispatchTyped (new CalendarDeletedEvent ($ calendarId , $ calendarData , $ shares ));
899
+ if ($ calendarData ) {
900
+ $ this ->dispatcher ->dispatchTyped (new CalendarDeletedEvent ((int )$ calendarId , $ calendarData , $ shares ));
901
+ }
900
902
}
901
903
902
904
/**
@@ -1124,7 +1126,7 @@ public function createCalendarObject($calendarId, $objectUri, $calendarData, $ca
1124
1126
$ calendarRow = $ this ->getCalendarById ($ calendarId );
1125
1127
$ shares = $ this ->getShares ($ calendarId );
1126
1128
1127
- $ this ->dispatcher ->dispatchTyped (new CalendarObjectCreatedEvent ($ calendarId , $ calendarRow , $ shares , $ objectRow ));
1129
+ $ this ->dispatcher ->dispatchTyped (new CalendarObjectCreatedEvent (( int ) $ calendarId , $ calendarRow , $ shares , $ objectRow ));
1128
1130
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject ' , new GenericEvent (
1129
1131
'\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject ' ,
1130
1132
[
@@ -1137,7 +1139,7 @@ public function createCalendarObject($calendarId, $objectUri, $calendarData, $ca
1137
1139
} else {
1138
1140
$ subscriptionRow = $ this ->getSubscriptionById ($ calendarId );
1139
1141
1140
- $ this ->dispatcher ->dispatchTyped (new CachedCalendarObjectCreatedEvent ($ calendarId , $ subscriptionRow , [], $ objectRow ));
1142
+ $ this ->dispatcher ->dispatchTyped (new CachedCalendarObjectCreatedEvent (( int ) $ calendarId , $ subscriptionRow , [], $ objectRow ));
1141
1143
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::createCachedCalendarObject ' , new GenericEvent (
1142
1144
'\OCA\DAV\CalDAV\CalDavBackend::createCachedCalendarObject ' ,
1143
1145
[
@@ -1198,7 +1200,7 @@ public function updateCalendarObject($calendarId, $objectUri, $calendarData, $ca
1198
1200
$ calendarRow = $ this ->getCalendarById ($ calendarId );
1199
1201
$ shares = $ this ->getShares ($ calendarId );
1200
1202
1201
- $ this ->dispatcher ->dispatchTyped (new CalendarObjectUpdatedEvent ($ calendarId , $ calendarRow , $ shares , $ objectRow ));
1203
+ $ this ->dispatcher ->dispatchTyped (new CalendarObjectUpdatedEvent (( int ) $ calendarId , $ calendarRow , $ shares , $ objectRow ));
1202
1204
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject ' , new GenericEvent (
1203
1205
'\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject ' ,
1204
1206
[
@@ -1211,7 +1213,7 @@ public function updateCalendarObject($calendarId, $objectUri, $calendarData, $ca
1211
1213
} else {
1212
1214
$ subscriptionRow = $ this ->getSubscriptionById ($ calendarId );
1213
1215
1214
- $ this ->dispatcher ->dispatchTyped (new CachedCalendarObjectUpdatedEvent ($ calendarId , $ subscriptionRow , [], $ objectRow ));
1216
+ $ this ->dispatcher ->dispatchTyped (new CachedCalendarObjectUpdatedEvent (( int ) $ calendarId , $ subscriptionRow , [], $ objectRow ));
1215
1217
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::updateCachedCalendarObject ' , new GenericEvent (
1216
1218
'\OCA\DAV\CalDAV\CalDavBackend::updateCachedCalendarObject ' ,
1217
1219
[
@@ -1261,7 +1263,7 @@ public function deleteCalendarObject($calendarId, $objectUri, $calendarType=self
1261
1263
$ calendarRow = $ this ->getCalendarById ($ calendarId );
1262
1264
$ shares = $ this ->getShares ($ calendarId );
1263
1265
1264
- $ this ->dispatcher ->dispatchTyped (new CalendarObjectDeletedEvent ($ calendarId , $ calendarRow , $ shares , $ data ));
1266
+ $ this ->dispatcher ->dispatchTyped (new CalendarObjectDeletedEvent (( int ) $ calendarId , $ calendarRow , $ shares , $ data ));
1265
1267
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject ' , new GenericEvent (
1266
1268
'\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject ' ,
1267
1269
[
@@ -1274,7 +1276,7 @@ public function deleteCalendarObject($calendarId, $objectUri, $calendarType=self
1274
1276
} else {
1275
1277
$ subscriptionRow = $ this ->getSubscriptionById ($ calendarId );
1276
1278
1277
- $ this ->dispatcher ->dispatchTyped (new CachedCalendarObjectDeletedEvent ($ calendarId , $ subscriptionRow , [], $ data ));
1279
+ $ this ->dispatcher ->dispatchTyped (new CachedCalendarObjectDeletedEvent (( int ) $ calendarId , $ subscriptionRow , [], $ data ));
1278
1280
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::deleteCachedCalendarObject ' , new GenericEvent (
1279
1281
'\OCA\DAV\CalDAV\CalDavBackend::deleteCachedCalendarObject ' ,
1280
1282
[
@@ -2116,7 +2118,7 @@ public function createSubscription($principalUri, $uri, array $properties) {
2116
2118
$ subscriptionId = $ this ->db ->lastInsertId ('*PREFIX*calendarsubscriptions ' );
2117
2119
2118
2120
$ subscriptionRow = $ this ->getSubscriptionById ($ subscriptionId );
2119
- $ this ->dispatcher ->dispatchTyped (new SubscriptionCreatedEvent ($ subscriptionId , $ subscriptionRow ));
2121
+ $ this ->dispatcher ->dispatchTyped (new SubscriptionCreatedEvent (( int ) $ subscriptionId , $ subscriptionRow ));
2120
2122
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::createSubscription ' , new GenericEvent (
2121
2123
'\OCA\DAV\CalDAV\CalDavBackend::createSubscription ' ,
2122
2124
[
@@ -2172,7 +2174,7 @@ public function updateSubscription($subscriptionId, PropPatch $propPatch) {
2172
2174
->execute ();
2173
2175
2174
2176
$ subscriptionRow = $ this ->getSubscriptionById ($ subscriptionId );
2175
- $ this ->dispatcher ->dispatchTyped (new SubscriptionUpdatedEvent ($ subscriptionId , $ subscriptionRow , [], $ mutations ));
2177
+ $ this ->dispatcher ->dispatchTyped (new SubscriptionUpdatedEvent (( int ) $ subscriptionId , $ subscriptionRow , [], $ mutations ));
2176
2178
$ this ->legacyDispatcher ->dispatch ('\OCA\DAV\CalDAV\CalDavBackend::updateSubscription ' , new GenericEvent (
2177
2179
'\OCA\DAV\CalDAV\CalDavBackend::updateSubscription ' ,
2178
2180
[
@@ -2222,7 +2224,9 @@ public function deleteSubscription($subscriptionId) {
2222
2224
->andWhere ($ query ->expr ()->eq ('calendartype ' , $ query ->createNamedParameter (self ::CALENDAR_TYPE_SUBSCRIPTION )))
2223
2225
->execute ();
2224
2226
2225
- $ this ->dispatcher ->dispatchTyped (new SubscriptionDeletedEvent ($ subscriptionId , $ subscriptionRow , []));
2227
+ if ($ subscriptionRow ) {
2228
+ $ this ->dispatcher ->dispatchTyped (new SubscriptionDeletedEvent ((int )$ subscriptionId , $ subscriptionRow , []));
2229
+ }
2226
2230
}
2227
2231
2228
2232
/**
@@ -2489,7 +2493,7 @@ public function updateShares($shareable, $add, $remove) {
2489
2493
]));
2490
2494
$ this ->calendarSharingBackend ->updateShares ($ shareable , $ add , $ remove );
2491
2495
2492
- $ this ->dispatcher ->dispatchTyped (new CalendarShareUpdatedEvent ($ calendarId , $ calendarRow , $ oldShares , $ add , $ remove ));
2496
+ $ this ->dispatcher ->dispatchTyped (new CalendarShareUpdatedEvent (( int ) $ calendarId , $ calendarRow , $ oldShares , $ add , $ remove ));
2493
2497
}
2494
2498
2495
2499
/**
@@ -2530,15 +2534,15 @@ public function setPublishStatus($value, $calendar) {
2530
2534
]);
2531
2535
$ query ->execute ();
2532
2536
2533
- $ this ->dispatcher ->dispatchTyped (new CalendarPublishedEvent ($ calendarId , $ calendarData , $ publicUri ));
2537
+ $ this ->dispatcher ->dispatchTyped (new CalendarPublishedEvent (( int ) $ calendarId , $ calendarData , $ publicUri ));
2534
2538
return $ publicUri ;
2535
2539
}
2536
2540
$ query ->delete ('dav_shares ' )
2537
2541
->where ($ query ->expr ()->eq ('resourceid ' , $ query ->createNamedParameter ($ calendar ->getResourceId ())))
2538
2542
->andWhere ($ query ->expr ()->eq ('access ' , $ query ->createNamedParameter (self ::ACCESS_PUBLIC )));
2539
2543
$ query ->execute ();
2540
2544
2541
- $ this ->dispatcher ->dispatchTyped (new CalendarUnpublishedEvent ($ calendarId , $ calendarData ));
2545
+ $ this ->dispatcher ->dispatchTyped (new CalendarUnpublishedEvent (( int ) $ calendarId , $ calendarData ));
2542
2546
return null ;
2543
2547
}
2544
2548
0 commit comments