0

i am new and some confused during create relation between entities (one to many) in symfony.i have make the relation in entity files but no any foreign key created . According to http://symfony.com/doc/current/doctrine/associations.html can i modify only entity class (src/AppBundle/Entity/Category.php) or orm file also(# src/AppBundle/Resources/config/doctrine/Category.orm.yml) .

  • Are you using annotations like @ORM\something in your entity file? If so then you need to delete any files under Resources/config/doctrine. You can use either annotations or yaml but not both at the same time. – Cerad Apr 12 '17 at 13:38
  • oneToMany not create any foreign key but manyToOne does. see this link for more details: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html – habibun Apr 13 '17 at 06:21
  • if i use annotation configuration for entity then hows database table create – ajay kumar Apr 13 '17 at 08:24

0 Answers0