Automate saving all items in a collection type

can we create a custom controller to save all the published items in a collection type without manually clicking on the save button