Answer the question
In order to leave comments, you need to log in
Doctrine how to bind entities?
Hello dear developers. I just started getting acquainted with doctrine, so I stumble over simple questions. And now, specifically, I can’t link several entities one-to-one. There is one basic entity, let's call it Token with fields id, userId, token and several others with an approximate structure - id, userId, ...something. According to the application logic, when requesting data from the database for any of these entities, it is also necessary to pull up data about the user token. All entities intersect by the key userId. Those. Once again, in tables, there is no token field, except for the Token entity and its tokens table. And as a hypothetical example, a getAll or findByUserId request is made to the payments table, so it is necessary that in the resulting array, the token property of the Payment entity receives the value corresponding to the entry from the tokens table (ex. Token).
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question