Best practice inserting Child in Doctrine without loading parent

48 views Asked by At

I have a database schema which consists of a Parent with n Childs. Now I want to insert a new child without loading the parent, so I dont have to perform an additional DB call. What is the best (most Doctrine like) way to perform such an operation?

1

There are 1 answers

0
malarzm On BEST ANSWER

DocumentManager::getReference will create an uninitialized proxy object for you. You can use that proxy object freely in your Child class, persist and flush will work normally.