I need to get all the dataobjects of a certain kind and perform actions on each of them, not inside the page controller but in the normal page class.
So I have:
$myobjectset = DataObject::get("MyObject");
foreach ($myobjectset as $singleobject) {
...
}
Silvertripe says that I give the wrong argument, and i may be understaing why, DataObject set it's not an array. What's the correct method of looping through a dataobject set?