Bonsoir,

Je développe une application sous sf 1.4. Dans mon modèle j'ai une relation de type many to many entre deux tables.

Je vous poste une partie de mon schema.yml, histoire d'avoir une idée.
Ma table de jointure est j_membre_formation et j'ai les relations :

Un membre peut faire une ou plusieurs formations.
Une formation est faite par un ou plusieurs membres.

Mon problème, lorsque je crée une nouvelle formation, je voudrais aussi renseigner automatiquement dans la table de jointure?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
 
Formation:
  connection: doctrine
  tableName: Formation
  columns:
    id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    niveau:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    periodedebut:
      type: date(25)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    periodefin:
      type: date(25)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    diplome:
      type: string(255)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    ecole:
      type: string(255)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    lieuecole:
      type: string(45)
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
    specialisation:
      type: string(255)
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
  relations:
    JMembreFormation:
      local: id
      foreign: formation_id
      type: many
 
JMembreFormation:
  connection: doctrine
  tableName: j_membre_formation
  columns:
    membre_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: false
    formation_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: false
  relations:
    Membre:
      local: membre_id
      foreign: id
      type: one
    Formation:
      local: formation_id
      foreign: id
      type: one
Membre:
  connection: doctrine
  tableName: Membre
  columns:
    id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    civilite:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    nom:
      type: string(50)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    prenom:
      type: string(50)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    email:
      type: string(50)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    telmobil:
      type: string(45)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
  relations:
    Offre:
      local: id
      foreign: membre_id
      type: many
    JMembreFormation:
      local: id
      foreign: membre_id
      type: many
Comment insérer dans une table de jointure?