Wednesday 14 May 2008 10:46:56 pm
Hi Felix, I would probably extend the class whose elements are to be sorted with en ezinteger type attribute, then create a cronjob that would periodically analyse the amount (or anything else) of relations and update the value and sorting field accordingly, which would then make it possible to quite efficiently apply sorting at the fetch attribute level, without loosing the ability to still apply other filters and parameters etc. I am thinking of direct current version modifications in the ezcontentobject_attribute table, so there might be risks here, and also it would have to be adjusted to the amount of classes to analyse. Also, the caching problem will be there to solve - is that list cache-blocked, or maybe we're talking about a browse list, whose cache will then have to be cleared. If you don't like the idea of that, you can always create a table where you will update and store the analysis results, and then create fetches or operators to reach the data. This could even not be cached, if needed (provided you create a method that will make it possible to fetch a collection of relation counts in one SQL query). Just my random thoughts ;)
Cheers, Piotrek
--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu
|