2019-12-03 18:57:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2019-09-16 16:09:43 +00:00
|
|
|
|
|
|
|
/**
|
2024-05-23 07:26:56 +00:00
|
|
|
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2019-09-16 16:09:43 +00:00
|
|
|
*/
|
|
|
|
namespace OC\Broadcast\Events;
|
|
|
|
|
|
|
|
use JsonSerializable;
|
|
|
|
use OCP\Broadcast\Events\IBroadcastEvent;
|
|
|
|
use OCP\EventDispatcher\ABroadcastedEvent;
|
|
|
|
use OCP\EventDispatcher\Event;
|
|
|
|
|
|
|
|
class BroadcastEvent extends Event implements IBroadcastEvent {
|
|
|
|
/** @var ABroadcastedEvent */
|
|
|
|
private $event;
|
|
|
|
|
|
|
|
public function __construct(ABroadcastedEvent $event) {
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
$this->event = $event;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName(): string {
|
|
|
|
return $this->event->broadcastAs();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getUids(): array {
|
|
|
|
return $this->event->getUids();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPayload(): JsonSerializable {
|
|
|
|
return $this->event;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setBroadcasted(): void {
|
|
|
|
$this->event->setBroadcasted();
|
|
|
|
}
|
|
|
|
}
|