2020-07-28 03:35:51 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2020-07-28 03:35:51 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\DAV\Events;
|
|
|
|
|
|
2025-05-14 09:29:02 -04:00
|
|
|
use OCA\DAV\CalDAV\CalDavBackend;
|
2020-07-28 03:35:51 -04:00
|
|
|
use OCP\EventDispatcher\Event;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class CalendarShareUpdatedEvent
|
|
|
|
|
*
|
|
|
|
|
* @package OCA\DAV\Events
|
|
|
|
|
* @since 20.0.0
|
2025-04-07 08:59:20 -04:00
|
|
|
*
|
2025-05-14 09:29:02 -04:00
|
|
|
* @psalm-import-type CalendarInfo from CalDavBackend
|
2020-07-28 03:35:51 -04:00
|
|
|
*/
|
|
|
|
|
class CalendarShareUpdatedEvent extends Event {
|
|
|
|
|
/**
|
|
|
|
|
* CalendarShareUpdatedEvent constructor.
|
|
|
|
|
*
|
|
|
|
|
* @param int $calendarId
|
2025-04-07 08:59:20 -04:00
|
|
|
* @psalm-param CalendarInfo $calendarData
|
|
|
|
|
* @param array $calendarData
|
2022-06-14 09:26:15 -04:00
|
|
|
* @param list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}> $oldShares
|
|
|
|
|
* @param list<array{href: string, commonName: string, readOnly: bool}> $added
|
|
|
|
|
* @param list<string> $removed
|
2020-07-28 03:35:51 -04:00
|
|
|
* @since 20.0.0
|
|
|
|
|
*/
|
2024-10-18 06:04:22 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private int $calendarId,
|
|
|
|
|
private array $calendarData,
|
|
|
|
|
private array $oldShares,
|
|
|
|
|
private array $added,
|
|
|
|
|
private array $removed,
|
|
|
|
|
) {
|
2020-07-28 03:35:51 -04:00
|
|
|
parent::__construct();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 20.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getCalendarId(): int {
|
|
|
|
|
return $this->calendarId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-04-07 08:59:20 -04:00
|
|
|
* @psalm-return CalendarInfo
|
|
|
|
|
* @return array
|
2020-07-28 03:35:51 -04:00
|
|
|
* @since 20.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getCalendarData(): array {
|
|
|
|
|
return $this->calendarData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-06-14 09:26:15 -04:00
|
|
|
* @return list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}>
|
2020-07-28 03:35:51 -04:00
|
|
|
* @since 20.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getOldShares(): array {
|
|
|
|
|
return $this->oldShares;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-06-14 09:26:15 -04:00
|
|
|
* @return list<array{href: string, commonName: string, readOnly: bool}>
|
2020-07-28 03:35:51 -04:00
|
|
|
* @since 20.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getAdded(): array {
|
|
|
|
|
return $this->added;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-06-14 09:26:15 -04:00
|
|
|
* @return list<string>
|
2020-07-28 03:35:51 -04:00
|
|
|
* @since 20.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getRemoved(): array {
|
|
|
|
|
return $this->removed;
|
|
|
|
|
}
|
|
|
|
|
}
|