I am creating an application that depends on 3rd party data from a REST API, and combines it with data from my own database.
I have a location
entity endpoint at API, that I need to query using filters defined by the API (query parameters), and get a list of events
at a given location
from my database using Doctrine.
The issue I have is if I request an event
and try to get its location
, I would have to do a request to the 3rd party for each event
.
I'm sure not the first one in need of combining different data sources but I haven't found much online about it.
I can cache the 3rd party data, perhaps to the database which would allow me to simply use Doctrine as usual?
Or should I create a doctrine repository thats not persisted in the database, if Doctrine allows that?
I feel like neither of those is an ideal approach. I looked into DoctrineRestDriver that I haven't tried using yet, but I don't (yet) see how would I define a different driver for a single data model (location
) and if I did manage that, how would I annotate the relation?
Thanks for any input!