public function link($referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        list($name, $params) = $this->getRouteNameAndParams();
        /** @var UrlGeneratorInterface $urlGenerator */
        $urlGenerator = $this->app['url_generator'];

        return $name ? $urlGenerator->generate($name, $params, $referenceType) : null;
    }