What should happen when m-n relation is updated? For example
// $a->hasManyToMany(..."B"...); $a = new A(); $b = new B(); $a->bs = array($b); $a->save(); // Ok, lets say we have a connection in the DB // However I have to save b manually, otherwise it doesn't work // Now, what if I do this $b2 = new B(); $a->bs = array($b2); $a->save();
What I expect to happen: remove a-b connection, b itself remains in the DB, b2 is created in DB with the new link a-b2. What really happens: a now has 2 connections, to b and b2
Is this a bug, or do I need to remove it myself? What is the best way to "disconnect" A and B entries?