Pitchcan contain many
Visuals are stored as a property on
Here's a quick diagram of the
Visuals table (
Pitches table (
statuses_pitch) and the join table created by Doctrine as a result.
Here's the relevant mapping information for
Visual has no mapping back to
Pitch because the relationship is unidirectional.
manyToMany: visuals: targetEntity: Visual cascade: ['persist', 'refresh', 'remove'] fetch: EAGER orphanRemoval: true joinTable: name: pitches_visuals joinColumns: pitch_id: referencedColumnName: id inverseJoinColumns: visual_id: referencedColumnName: id
I am making the changes to a
Visual in the
Pitch and then calling
$em->flush($pitch). The changes to the child
Visual are not persisted to the database as I expect.
Here's what the
Pitch object looks like before I persist it. Note that the
Visual objects have a
visualType property (mapped to
visual_type in the db). These are not null when persisting.
Here's the database table after persisting. Note that the
visual_type column still has null in there and the change was not persisted.
I have tried
- Through complete laziness thrown cascades all over the place, to no avail - Changed the cascade refresh from the owning (pitch) to inverse (visual) side - Looked through the docs to see if cascade refresh is affected specifically in a Many-To-Many relationship - I couldn't find anything concrete on this, or if there *is* a problem, how I would get around it
How can I achieve what I need here, by making a change to