public function onSerialize(DecorateResourceNodeEvent $event)
    {
        $options = $event->getOptions();

        if (!in_array(Options::SKIP_RESOURCE_NOTIFICATION, $options)) {
            $node = $event->getResourceNode();
            $user = $this->tokenStorage->getToken()->getUser();
            $followResource = $user !== 'anon.' ?
                $this->notificationManager->getFollowerResource(
                    $user->getId(),
                    $node->getId(),
                    $node->getClass()
                ) :
                false;

            $event->add('notifications', ['enabled' => !empty($followResource)]);
        }
    }