RegisterSerializationClassesCompilerPass
class RegisterSerializationClassesCompilerPass extends RegisterSerializationClassesCompilerPass (View source)
| internal | JSON:API maintains no PHP API. The API is the HTTP API. This class may change at any time and could break any dependencies on it. |
Adds services tagged JSON:API-only normalizers to the Serializer.
Services tagged with 'jsonapi_normalizer' will be added to the JSON:API serializer. No extensions can provide such services.
JSON:API does respect generic (non-JSON:API) DataType-level normalizers.
Constants
| OVERRIDDEN_SERVICE_ID |
The service ID. |
| OVERRIDDEN_SERVICE_NORMALIZER_TAG |
The service tag that only JSON:API normalizers should use. |
| OVERRIDDEN_SERVICE_ENCODER_TAG |
The service tag that only JSON:API encoders should use. |
| FORMAT |
The ID for the JSON:API format. |
Methods
Adds services to the JSON:API Serializer.
Details
process(ContainerBuilder $container)
Adds services to the JSON:API Serializer.
This code is copied from the class parent with two modifications. The service id has been changed and the service tag has been updated.
ID: 'serializer' -> 'jsonapi.serializer' Tag: 'normalizer' -> 'jsonapi_normalizer'
protected array
sort(array $services)
Sorts by priority.
Order services from highest priority number to lowest (reverse sorting).