Y
Y
yuriy-graf2015-10-08 12:58:01
symfony
yuriy-graf, 2015-10-08 12:58:01

How in symfony / doctrine for an entity that does not come from the database, build a relation?

I have an entity.
The data for this entity is not retrieved from the database, but is retrieved by a GET request from a third-party service.
Comments and some other data are stored for this entity, but they are already stored on my server in MySQL.
What I want to do:
Pulled data (JSON) from the service, mapped it to an object inside the application.
And using the "getReviews()" method to call lazy loading to the application database.
How to properly organize this in the concept of doctrine?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis, 2015-10-08
@prototype_denis

Comments and some other data are stored for this entity , but they are already stored on my server in MySQL.

That is, there is an identifier, as I understand it. Otherwise, how would you differentiate between them?
The problem goes away on its own. The question is only in the implementation ...
But if you need to bind data from the database to an entity taken from the ceiling, then Ruslan Kvashnin already suggested how to do this

R
Ruslan Kvashnin, 2015-10-08
@RussellKvashnin

What you are talking about is not an entity, it is POPO (Plain Old PHP Object).
Please describe the problem in more detail. What will happen to this object next? And with the objects connected with it (reviews)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question