Creates a URL for the content record.

@param int $referenceType

@return string|null
423359
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;
    }
225633
public function url($pageName, $pageType = PageTypes::NORMAL, $pageRevision = null)
    {
        /** @var \Zend\Mvc\Controller\AbstractActionController $controller */
        $view = $this->getView();

        if ($pageType == PageTypes::NORMAL && $pageName == 'index' && empty($pageRevision)) {
            return '/';
        } elseif ($pageType == PageTypes::NORMAL && empty($pageRevision)) {
            return $view->url(
                'contentManager',
                ['page' => $pageName]
            );
        } elseif ($pageType == PageTypes::NORMAL && !empty($pageRevision)) {
            return $view->url(
                'contentManager',
                [
                    'revision' => $pageRevision,
                    'page' => $pageName,
                ]
            );
        } elseif ($pageType != PageTypes::NORMAL && !empty($pageRevision)) {
            return $view->url(
                'contentManagerWithPageType',
                [
                    'revision' => $pageRevision,
                    'pageType' => $pageType,
                    'page' => $pageName,
                ]
            );
        } else {
            return $view->url(
                'contentManagerWithPageType',
                [
                    'pageType' => $pageType,
                    'page' => $pageName,
                ]
            );
        }
    }
144807
public function getPreviousUrl(bool $fallBackToReferer = true) : string
    {
        if (!empty($this->previousUrl)) {
            return $this->previousUrl;
        }

        if ($fallBackToReferer) {
            return $this->headers->get('REFERER', '');
        }

        return '';
    }
298027
public static function newDocument($markup = null, $contentType = null) 
    {
        if (! $markup) {
            $markup = '';
        }
        $documentID = phpQuery::createDocumentWrapper($markup, $contentType);
        return new phpQueryObject($documentID);
    }
1319417
public function fetchRefererUrl(): string
    {
        $url = $this->session->get($this->refererUrlKey, '');
        $this->session->remove($this->refererUrlKey);

        return $url;
    }
714140
protected function startResolution(UriInterface $referenceUri)
    {
        $resolution = new Value\PlaceholderValue;
        $this->resolutions[$referenceUri->toString()] = $resolution;

        return $resolution;
    }
517274
protected function resolution(UriInterface $referenceUri)
    {
        $key = $referenceUri->toString();
        if (array_key_exists($key, $this->resolutions)) {
            return $this->resolutions[$key];
        }

        return null;
    }
918785
function urls($type = NULL)
	{
		switch($type)
		{
			case 'unlink':
				return '/_bors/admin/cross_unlink?from='
					.object_property($this->from_object(), 'internal_uri')
					.'&to='.object_property($this->target(), 'internal_uri');
		}

		return parent::urls($type);
	}
840028
public function getRecord($recordId, $contentTypeName = null, DataDimensions $dataDimensions = null)
    {

        if ($contentTypeName == null)
        {
            $contentTypeName = $this->getCurrentContentTypeName();
        }

        if ($dataDimensions == null)
        {
            $dataDimensions = $this->getCurrentDataDimensions();
        }

        if ($this->hasContentType($contentTypeName))
        {
            if ($this->hasStashedRecord($contentTypeName, $recordId, $dataDimensions))
            {
                return $this->getStashedRecord($contentTypeName, $recordId, $dataDimensions, $this->getRecordClassForContentType($contentTypeName));
            }
            $url = 'content/' . $contentTypeName . '/record/' . $recordId . '/' . $dataDimensions->getWorkspace() . '?language=' . $dataDimensions->getLanguage() . '&view=' . $dataDimensions->getViewName() . '&timeshift=' . $dataDimensions->getTimeShift();;

            try
            {
                $response = $this->getClient()->get($url);
            }
            catch (ClientException $e)
            {
                if ($e->getCode() == 404)
                {
                    return false;
                }
                throw new AnyContentClientException ($e->getMessage());
            }

            $json = $response->json();

            $record = $this->getRecordFactory()
                           ->createRecordFromJSON($this->getContentTypeDefinition($contentTypeName), $json['record']);

            $this->stashRecord($record, $dataDimensions);

            return $record;
        }

        throw new AnyContentClientException ('Unknown content type ' . $contentTypeName);

    }
748683
public function getNodeTypeNamesDeniedForCreation(NodeInterface $referenceNode)
    {
        $privilegeSubject = new CreateNodePrivilegeSubject($referenceNode);

        $allNodeTypes = $this->nodeTypeManager->getNodeTypes();

        $deniedCreationNodeTypes = [];
        $grantedCreationNodeTypes = [];
        $abstainedCreationNodeTypes = [];
        foreach ($this->securityContext->getRoles() as $role) {
            /** @var CreateNodePrivilege $createNodePrivilege */
            foreach ($role->getPrivilegesByType(CreateNodePrivilege::class) as $createNodePrivilege) {
                if (!$createNodePrivilege->matchesSubject($privilegeSubject)) {
                    continue;
                }

                $affectedNodeTypes = ($createNodePrivilege->getCreationNodeTypes() !== [] ? $createNodePrivilege->getCreationNodeTypes() : $allNodeTypes);

                if ($createNodePrivilege->isGranted()) {
                    $grantedCreationNodeTypes = array_merge($grantedCreationNodeTypes, $affectedNodeTypes);
                } elseif ($createNodePrivilege->isDenied()) {
                    $deniedCreationNodeTypes = array_merge($deniedCreationNodeTypes, $affectedNodeTypes);
                } else {
                    $abstainedCreationNodeTypes = array_merge($abstainedCreationNodeTypes, $affectedNodeTypes);
                }
            }
        }
        $implicitlyDeniedNodeTypes = array_diff($abstainedCreationNodeTypes, $grantedCreationNodeTypes);
        return array_merge($implicitlyDeniedNodeTypes, $deniedCreationNodeTypes);
    }
679300
public function createPage(
        $refEntityType,
        $pageTitle,
        $locale,
        Node $parentNode = null)
    {
        $user = $this->getAdminUser();

        $newPage = $this->createNewPage($refEntityType, $pageTitle);
        if (null !== $parentNode) {
            $parentNodeTranslation = $parentNode->getNodeTranslation($locale, true);
            $parentNodeVersion = $parentNodeTranslation->getPublicNodeVersion();
            $parentPage = $parentNodeVersion->getRef($this->em);
            $newPage->setParent($parentPage);
        }

        /* @var Node $nodeNewPage */
        $nodeNewPage = $this->em->getRepository('KunstmaanNodeBundle:Node')->createNodeFor($newPage, $locale, $user);
        $nodeTranslation = $nodeNewPage->getNodeTranslation($locale, true);
        if (null !== $parentNode) {
            $weight = $this->em->getRepository('KunstmaanNodeBundle:NodeTranslation')->getMaxChildrenWeight(
                    $parentNode,
                    $locale
                ) + 1;
            $nodeTranslation->setWeight($weight);
        }

        if ($newPage->isStructureNode()) {
            $nodeTranslation->setSlug('');
        }

        $this->em->persist($nodeTranslation);
        $this->em->flush();

        $nodeVersion = $nodeTranslation->getPublicNodeVersion();

        $this->eventDispatcher->dispatch(
            Events::ADD_NODE,
            new NodeEvent(
                $nodeNewPage, $nodeTranslation, $nodeVersion, $newPage
            )
        );

        return $nodeTranslation;
    }
1309223
public function startCreatingContent(string $contentType): ContentUpdateItemPage
    {
        $this->rightMenu->clickButton('Create');

        $contentTypePicker = ElementFactory::createElement($this->context, ContentTypePicker::ELEMENT_NAME);
        $contentTypePicker->select($contentType);

        $contentUpdatePage = PageObjectFactory::createPage($this->context, ContentUpdateItemPage::PAGE_NAME, $contentType);
        $contentUpdatePage->verifyIsLoaded();

        return $contentUpdatePage;
    }
549900
public function getReferenceRepository()
    {
        if ( ! $this->referenceRepository) {
            $this->referenceRepository = new ProxyReferenceRepository($this->entityManager);
        }

        return $this->referenceRepository;
    }
534203
protected function generateRoute($name, $parameter = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_URL)
    {
        return $this->getRouter()->generate($name, $parameter, $referenceType);
    }
1080024
public function getArticleTagRouterPath($slug, $tag, $locale, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        $routeName = sprintf('_slug_tag_%s', $locale);

        return $this->getArticleRouterPath($routeName, 'tag', $slug, $tag, $locale, $parameters, $referenceType);
    }
1156716
public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH): string
    {
        if (!$name instanceof Location) {
            throw new RouteNotFoundException('Could not match route');
        }

        return $this->generator->generate(
            $name->innerLocation,
            $parameters,
            $referenceType
        );
    }
1283256
public function getLinkField($linkType)
    {
        if (property_exists($this->data, 'links') && property_exists($this->data->links, $linkType)) {
            return $this->data->links->{$linkType};
        } else {
            return null;
        }
    }