Subscription enumeration, tweaks
This commit is contained in:
@ -53,6 +53,27 @@ class TopicManager
|
||||
}
|
||||
}
|
||||
|
||||
public function getSubscriptions(): array
|
||||
{
|
||||
$all = [];
|
||||
|
||||
foreach ($this->topics as $topic) {
|
||||
$subs = $topic->getSubscribers();
|
||||
foreach ($subs as $sub) {
|
||||
$all[] = [
|
||||
'id' => './well-known/mercure/subsciptions/'.urlencode($topic->getTopic())."/".urlencode($sub->getId()),
|
||||
'type' => "Subscription",
|
||||
'topic' => $topic->getTopic(),
|
||||
'subscriber' => $sub->getId(),
|
||||
'active' => true,
|
||||
'payload' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $all;
|
||||
}
|
||||
|
||||
public function getTopicCount(): int
|
||||
{
|
||||
return count($this->topics);
|
||||
|
Reference in New Issue
Block a user