Question

I have 2 entities: SectionAdmin and Section.

The relation is ManyToOne from SectionAdmin to Section.

Now, in the MySQL table, I can add section_id to be 0, that means that the SectionAdmin will be admin of all the sections, but Doctrine is not allowing me to do that.

I need to specify a valid Section object.

Any idea on how to do that?

Was it helpful?

Solution

I did this in an easier way:

$insertEditorRightSQL = "INSERT INTO section_admin(section_id) VALUES (0) ";

$insertEditorRight = $em->getConnection()->prepare($insertEditorRightSQL); 
$insertEditorRight->execute();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top