ResourceTypeConverter
class ResourceTypeConverter implements ParamConverterInterface (View source)
| internal | JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it. |
Parameter converter for upcasting JSON:API resource type names to objects.
Constants
| PARAM_TYPE_ID |
The route parameter type to match. |
Properties
| protected ResourceTypeRepositoryInterface | $resourceTypeRepository | The JSON:API resource type repository. |
Methods
__construct(ResourceTypeRepositoryInterface $resource_type_repository)
ResourceTypeConverter constructor.
mixed|null
convert(mixed $value, mixed $definition, string $name, array $defaults)
Converts path variables to their corresponding objects.
bool
applies(mixed $definition, string $name, Route $route)
Determines if the converter applies to a specific route and variable.
Details
__construct(ResourceTypeRepositoryInterface $resource_type_repository)
ResourceTypeConverter constructor.
mixed|null
convert(mixed $value, mixed $definition, string $name, array $defaults)
Converts path variables to their corresponding objects.
bool
applies(mixed $definition, string $name, Route $route)
Determines if the converter applies to a specific route and variable.