symfony - Doctrine manyToMany Definition not Working Undefined index: joinTable -


i trying manytomay bi-directional mapping working on symfony 3.2.6 / php 7.1. unable

php bin/console doctrine:schema:update --dump-sql  

command run without error

[symfony\component\debug\exception\contexterrorexception] notice: undefined index: jointable

definition follows:

busybee\studentbundle\entity\student:     type: entity     table: student     repositoryclass: busybee\studentbundle\repository\studentrepository     id:         id:             type: integer             id: true             generator:                 strategy: auto     fields:         startatschool:             type: date     manytomany:         enrolments:             targetentity: busybee\studentbundle\entity\enrolment             mappedby: students 

and

busybee\studentbundle\entity\enrolment:     type: entity     table: enrolment     repositoryclass: busybee\studentbundle\repository\enrolmentrepository     id:         id:             type: integer             id: true             generator:                 strategy: auto     fields:         status:             type: string             length: '32'         lastmodified:             type: datetime         createdon:             type: datetime     manytomany:         students:             targetentity: busybee\studentbundle\entity\student             inversedby: enrolments 

if remove mappedby in student entity sql generate using doctrine:schema:update command. example @ http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html#owning-and-inverse-side-on-a-manytomany-association shows jointable index on inversedby entity, , adding jointable or mappedby entity still generates error undefined index: jointable

so, if doing wrong? bug? appreciated.

craig

i found issue here. not doctrine problem, subscriber had written add table prefix. have updated code table prefix subscriber correctly capture when definition manytomany association , ignore non-owning side. using table prefix code doctrine site @ http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/sql-table-prefixes.html

craig.


Comments