I have one collection in a method where I want to perform two different operations on this collection. So, I want two separate copies of same collection, and then assign one of the two collections to original collection again and return it.
To make this simple, suppose I have an object collection called
Now, I am trying it with PHP cloning as I don’t know if there is any Magento collection cloning inbuilt or not.
$coll1 = clone $collection; $coll2 = clone $collection;