metadata = $metadata; $this->webSocketSubmission = $webSocketSubmission; $this->config = $config; } /** * @param array $options */ public function afterSave(Entity $entity, array $options): void { if ($options['silent'] ?? false) { return; } if ($entity->isNew()) { return; } if (!$this->config->get('useWebSocket')) { return; } $scope = $entity->getEntityType(); $id = $entity->getId(); if (!$this->metadata->get(['scopes', $scope, 'object'])) { return; } $topic = "recordUpdate.{$scope}.{$id}"; $this->webSocketSubmission->submit($topic, null); } }