Author: robert
Description:
Adds two method to Category, getMemberIds() and getMemberTitles().
Several extension deal with all the members of a category in some way, it would be useful to have methods that allow one to get an array containing titles for all members in a category.
The attached patch adds two methods to the Category class:
- getMemberIds() for getting an array of category page ids,
- getMemberTitles() for getting an array of title objects for these page ids.
The arrays behind these are only generated when the methods are actually called (but are cached in member variables), to save on memory usage; and are ordered by the category sort key.
While this solution is clearly only adequate on smaller categories, most of the extensions that require such methods are aimed at smaller wikis - and this is therefore not a significant issue. It is often the case that certain extensions would break or need redesigning if faced with thousands, rather than hundreds, of pages in a category (this is not necesserily a bad point however, due to the primary target of such extensions). In the future if large categories need to be scanned, heavy duty progressive methods could be introduced in some way - but this is not yet necessary.
I'd appreciate it if someone could take a look over the patch, give comments, and possibly advice as to whether or not it would be suitable for core integration - after which case I will commit it if there is agreement.
Version: unspecified
Severity: enhancement
attachment categories.diff ignored as obsolete