diff options
author | Robin Appelman <robin@icewind.nl> | 2023-07-25 17:08:50 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2023-07-26 14:36:37 +0200 |
commit | 31c483b759ddca29e6d0a511205c41267fc762bf (patch) | |
tree | 0145942fdf8f66fde8f5ae78c239dfb15ca458e9 /apps/dav/lib/CalDAV/CalendarHome.php | |
parent | 19e7704c85d0e8aa1c8ea2ca7e8bf47d549ec0e2 (diff) | |
download | nextcloud-server-31c483b759ddca29e6d0a511205c41267fc762bf.tar.gz nextcloud-server-31c483b759ddca29e6d0a511205c41267fc762bf.zip |
preload shares for calendars when listing calendars
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib/CalDAV/CalendarHome.php')
-rw-r--r-- | apps/dav/lib/CalDAV/CalendarHome.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/dav/lib/CalDAV/CalendarHome.php b/apps/dav/lib/CalDAV/CalendarHome.php index a59e76d121f..cbf5cebc9e7 100644 --- a/apps/dav/lib/CalDAV/CalendarHome.php +++ b/apps/dav/lib/CalDAV/CalendarHome.php @@ -58,6 +58,7 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome { /** @var LoggerInterface */ private $logger; + private ?array $cachedChildren = null; public function __construct(BackendInterface $caldavBackend, $principalInfo, LoggerInterface $logger) { parent::__construct($caldavBackend, $principalInfo); @@ -97,6 +98,9 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome { * @inheritdoc */ public function getChildren() { + if ($this->cachedChildren) { + return $this->cachedChildren; + } $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']); $objects = []; foreach ($calendars as $calendar) { @@ -136,6 +140,7 @@ class CalendarHome extends \Sabre\CalDAV\CalendarHome { } } + $this->cachedChildren = $objects; return $objects; } |