is it possible to sort by the summation of relations' objects values?
• Team has_many Players
Team::get()->sort(['PlayersPointsTotal' => 'ASC']);
I guess not out of the box, according to https://github.com/silverstripe/silverstripe-framework/issues/9108
It's not possible to use the Database-abstraction features in the ORM to create DataLists that are sorted by aggregates. However you can filter by them.
Steps to Reproduce
Hava a many_many relation, like Team <-> Fan, then you can do:
(get Teams with more than 10 Fans)
but you cannot do
(trying to get list sorted by number of Fans, but fails with database error - excecute command denied for routine Fans.Count)
you can sort on a callback that calculates the points. Would be a bottleneck if you have tons of teams.
we've got some manipulation to do, but close to the same
write to the stream or something
I suppose I could create a csv in the same dir as the originating file that's blank
really what I'm going for is uploading a file to the asset directory... then have an action menu option to do the conversion... but that's step 2 of x lol
PHP interns... I use notepad ++... 😬 , here... try this...
IDE hints totally changed how I work once I switched, never going back... ever