willdurand / BazingaHateoasBundle

Integration of the Hateoas library into Symfony.
MIT License
294 stars 59 forks source link

Added relation provider compiler pass #35

Closed dantleech closed 9 years ago

dantleech commented 9 years ago

This PR adds a compiler pass which adds services tagged with hateoas.relation_provider to the chain provider.

Aims to fix #27

dantleech commented 9 years ago

Hmm. this actually only adds the resolver services which is not exactly what I intended.

adrienbrault commented 9 years ago

@dantleech You cannot add a RelationProvider, you could only replace it, which would "break" the library. Adding a RelationProviderResolverInterface is what you should want.

:+1: for the code once my comment is addressed

dantleech commented 9 years ago

Updated.

adrienbrault commented 9 years ago

Looks good :+1:

willdurand commented 9 years ago

Cool! Can I ask for some documentation? :fearful:

dantleech commented 9 years ago

Added some documentation, would have added some more detail but I havn't actually tried this feature out yet.

I am trying to get Hateoas support in the SonataAdminBundle so that it can add links for the Symfony CMF ResourceRestBundle.

willdurand commented 9 years ago

Thanks

kayue commented 9 years ago

@dantleech @willdurand It seems the chain resolver isn't being applied automatically. I have to do the following in order to use the chain resolver.

Product:
    exclusion_policy: ALL
    relation_providers: [hateoas.configuration.provider.resolver.chain]