Hello,

Many admins may have many departments.

in Admin.php I have:

  $metadata->mapManyToMany(array( 'fieldName' => 'departments',
                                                'targetEntity' =>
'HdDepartment',
                                                'cascade' =>
array('persist','merge'),
                                                'inversedBy' => 'admins'
                                              )
                                        );

in HdDepartment.php I have:

$metadata->mapManyToMany(array('fieldName' => 'admins',
                               'targetEntity' => 'Entities\\Admin',
                               'cascade' => array('persist', 'merge'),
                               'mappedBy' => 'departments'
                              )
                         );
When I delete a department, the relation in admin_to_hddepartment join
table is deleted too and admin is NOT deleted, this is fine until now.
But when I delete admin, only admin itself is deleted, I don't want
department will be deleted in this case and it is not as expected, still
fine, but the relation remains in join table and it would be something
orphan.
How to delete this orphan record from admin_to_hddepartment join table?

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to