Reference
C
Class

ApiPlatform\Api\UriVariablesConverter

UriVariables converter that chains uri variables transformers.

class ApiPlatform\Api\UriVariablesConverter implements `<a href="/docs/reference/Api/UriVariablesConverterInterface">ApiPlatform\Api\UriVariablesConverterInterface</a>`
{
    public __construct(ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, iterable $uriVariableTransformers)
    public convert(array $uriVariables, string $class, array $context): array
}
class ApiPlatform\Api\UriVariablesConverter implements `<a href="/docs/reference/Api/UriVariablesConverterInterface">ApiPlatform\Api\UriVariablesConverterInterface</a>`
{
    public __construct(ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, iterable $uriVariableTransformers)
    public convert(array $uriVariables, string $class, array $context): array
}

Methods

__construct

public __construct(ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, iterable $uriVariableTransformers)
public __construct(ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, iterable $uriVariableTransformers)

Parameters

propertyMetadataFactoryApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface
resourceMetadataCollectionFactoryApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface
uriVariableTransformersiterable

convert

Takes an array of strings representing URI variables (identifiers) and transform their values to the expected type.

public convert(array $uriVariables, string $class, array $context): array
public convert(array $uriVariables, string $class, array $context): array

Parameters

uriVariablesarray
classstring
contextarray

Returns

array

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop