get('id'); $user = $this->actor->getUser(); // if ($params->get('notifications.isRead')) { $command = new ReadNotificationCommand($notificationId, $user); $notification = $this->dispatch($command, $params); // } // Presumably, the discussion was updated successfully. (One of the command // handlers would have thrown an exception if not.) We set this // discussion as our document's primary element. $serializer = new NotificationSerializer; $document = $this->document()->setData($serializer->resource($notification)); return $this->respondWithDocument($document); } }