Closed baldurrensch closed 11 years ago
I don't think that creating a serializer handler for an interface makes sense.
It would be misleading, what if someone creates a class, adds some properties with serializer metadata, and implements the PagedCollectionInterface
?
The properties and their metadata will be ignored and only the collection stuff will be serialized (the links will also be serialized because they're added via an eventsubscriber).
So, should I then just get rid of the interface and bind the listener to the class itself?
@baldurrensch What's the advantage of the interface here instead of extending from the current HalPagerfanta
?
I figured it would provide more freedom.
Yeah, I think at first I wanted to keep both for BC. Then, I wanted to get rid of it. But actually they are totally BC. So maybe, I just need to improve the HalPagerfanta
(don't like the name though, but anyways), and adjust the other small changes. What do you think?
You can rename it if you want, we'll just have to increase the version.
Not needed anymore. The current solution with @JMS\Inline
is way superior.
I rewrote the way that paged collections with HAL work to be more flexible and elegant. Now, there is an interface
Model/PagedCollectionInterface.php
that needs to be implemented. There is also a concrete classModel/PagedCollection.php
that can be inherited from that already has the getters and setters implemented. This interface or class can be used to create custom paginated results. That way, we can use annotations to create additional links for the resources, as well as additional properties (or embedded objects).This still needs: