Вопрос

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?

Это было полезно?

Решение

I did this in an easier way:

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

$insertEditorRight = $em->getConnection()->prepare($insertEditorRightSQL); 
$insertEditorRight->execute();
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top