R
R
Roman Gor2017-03-01 03:34:50
MySQL
Roman Gor, 2017-03-01 03:34:50

Doctrine: ORM & ODM Relations. How?

Actually, subject.
How to build relationships between MySQL Entity and mongodb Document?
Example:
There is an entity User.
There is a Comment document.
When creating a Comment, the user_id is set explicitly: $comment->setUser($user->getId());
How can I get User with $comment->getUser(); instead of just user_id?
PYSY: the easiest way is to expand the repositories, and in fact, add the logic with handles. But I'm looking for some more elegant way.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2017-03-01
@RomanGorbatko

Take a look at StofDoctrineExtensionsBundle
https://symfony.com/doc/current/bundles/StofDoctri...
https://github.com/Atlantic18/DoctrineExtensions/b...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question