How can I check if a DataObject is already in a DataObjectSet? I tried in_array() but it can´t cope with object sets.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
You could try using containsIDs() and passing in the ID of your dataobject or you could use find().
$set->containsIDs(array($object->ID));
// or
$set->find('ID', $object->ID);
Great, thanks willr.