Domanda

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?

È stato utile?

Soluzione

I did this in an easier way:

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

$insertEditorRight = $em->getConnection()->prepare($insertEditorRightSQL); 
$insertEditorRight->execute();
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top