Details
-
Type:
Improvement
-
Status:
Reopened
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.1
-
Fix Version/s: 2.4
-
Component/s: None
-
Security Level: All
-
Labels:None
Description
Using the following code, when you go from (1, 2) to (1), (2) is deleted as expected. However, if you go from (1, 2) to (2), (1) and (2) are deleted and (2) is then inserted. Is this the desired behaviour? (i.e. 2 extra queries)
$bracket->getTournamentLocations()->takeSnapshot();
$col = $bracket->getTournamentLocations()->unwrap();
$col->clear();
foreach ($form->getValue('tournamentLocations') as $id) {
$col->add($em->getReference('Tournaments_Model_TournamentLocation', $id));
}
$bracket->getTournamentLocations()->setDirty(true);
First, you are using internal API therefore you are on your own anyways.
This is marked as improvment now, the functionality works, it may just be inefficient.