File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ services:
7777 App\Services\BirthdayService :
7878 arguments :
7979 $birthdayReminderOffset : " %birthday_reminder_offset%"
80+ $calendarBackend : null # will be overridden when instantiated manually
8081
8182 App\Security\ApiKeyAuthenticator :
8283 arguments :
Original file line number Diff line number Diff line change 1919use App \Entity \Card ;
2020use App \Entity \Principal ;
2121use Doctrine \Persistence \ManagerRegistry ;
22- use Sabre \DAV \Sharing \Plugin as SharingPlugin ;
2322use Sabre \CalDAV \Backend \PDO as CalendarBackend ;
23+ use Sabre \DAV \Sharing \Plugin as SharingPlugin ;
2424use Sabre \VObject \Component \VCalendar ;
2525use Sabre \VObject \Component \VCard ;
2626use Sabre \VObject \DateTimeParser ;
@@ -34,8 +34,13 @@ class BirthdayService
3434 public function __construct (
3535 private ManagerRegistry $ doctrine ,
3636 private string $ birthdayReminderOffset ,
37- private CalendarBackend $ calendarBackend ,
37+ private ? CalendarBackend $ calendarBackend = null ,
3838 ) {
39+ if (!$ calendarBackend ) {
40+ $ em = $ this ->doctrine ->getManager ();
41+ $ pdo = $ em ->getConnection ()->getNativeConnection ();
42+ $ this ->calendarBackend = new CalendarBackend ($ pdo );
43+ }
3944 }
4045
4146 public function onCardChanged (int $ addressBookId , string $ cardUri , string $ cardData ): void
You can’t perform that action at this time.
0 commit comments