ApiPlatform\Core\JsonLd\ContextBuilder::getEntrypointContext PHP 메소드

getEntrypointContext() 공개 메소드

public getEntrypointContext ( integer $referenceType = UrlGeneratorInterface::ABS_PATH ) : array
$referenceType integer
리턴 array
    public function getEntrypointContext(int $referenceType = UrlGeneratorInterface::ABS_PATH) : array
    {
        $context = $this->getBaseContext($referenceType);
        foreach ($this->resourceNameCollectionFactory->create() as $resourceClass) {
            $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
            $resourceName = lcfirst($resourceMetadata->getShortName());
            $context[$resourceName] = ['@id' => 'Entrypoint/' . $resourceName, '@type' => '@id'];
        }
        return $context;
    }