addDependency('webSocketSubmission'); } public function afterSave(Entity $entity, array $options = []) { if (!$this->getConfig()->get('useWebSocket')) return; if (!$entity->isNew()) return; $userId = $entity->get('userId'); if (!$userId) return; $this->getInjection('webSocketSubmission')->submit('newNotification', $userId); } }