I have a problem with my ManyToMany attitude in doctrine2. The relationship is not maintained, even if the relationship exists. If I check that they are stored in two foreach loops, the correct objects are returned.
The first class is the Document.
class Document extends BaseEntity { .... protected $jobs; ....
Second grade - Job
class Job extends BaseEntity { .... protected $documents; ....
In my controller, I do the following:
$job->addDocument($document); $document->addJob($job); $em->persist($job); $em->flush();
Add functions work fine. I can see this when I scroll through objects, and I do it.
source share