I'm combining two DataObjectSets and I want only the unique entries.
I thought it was an error in my code, but it appears to me that removeDuplicates() actually removes all entries. I'm not quite sure whether it's a bug as I may have something else wrong in the code. I've written a quick test script, can someone please verify whether this is a bug or an error on my side?
$one = new DataObject();
$one->ID = 1;
$one->Title = "One";
$two = new DataObject();
$two->ID = 2;
$two->Title = "Two";
$test = new DataObjectSet();
$test->addWithoutWrite ($one);
$test->addWithoutWrite ($two);
$test->addWithoutWrite ($one);
Debug::show($test); // Shows 1 2 1
Debug::show($test->removeDuplicates()); // Empty.