I built a simple API in symfony2 with doctrine 2 (with a little help from here: http://williamdurand.fr/2012/08/02/rest-apis-with-symfony2-the-right-way/). Everything works fine. GET (All/One), PUT, POST or DELETE works, but I can either fetch all Resources or only one with a specific Id.
But I want something like this:
GET /api/stuff?filter={
[
{
"field": "fieldname",
"operator": "eq",
"value": "foo"
},
{
...
}
]
}
and then call getByFilter($filter)
to build a generic DQL.
I have a pretty clear idea how to do it (I did something similar, without symfony), but I don't want to reinvent the wheel.
Are there any bundles or best practices out there?