I’m on my mobile at the moment, but think the simplest way would be to shuffle()
the asArray of your Collection result.
Correct, sounds like a good feature request. In the meantime, you could do it with two queries to help it have a low memory footprint. The first using ->fields()
so it doesn’t return a full data set. Then shuffle()
the asArray()
result, chop off however many you need, and use those primary keys as filters in a second query to get all of your data.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.