Hi, I have an ArrayList which I use to collect data objects from an external source and render them in my Silverstripe template.
But I now find that I need to edit some of the objects in the list, after the list is populated.
If it were an array, I would just do something like
$key = array_search($id,$my_array);
if ($key !== false){
$my_array[$key]->my_field = $new_value;
}
...but I can't figure out the syntax to do this in an ArrayList.
Is it possible, or do I need to refactor, to do my edits prior to building the ArrayList?
Cheers!