Page MenuHomePhabricator

Deprecated TitleArray and replace it with PageSelectQueryBuilder
Open, MediumPublic


TitleArray is a utility for creating Title instances on the fly, based on a result set containing rows form the page table.

Instead of Title instances, we want to use PageIdentity or PageStoreRecord objects instead. A convenient way to construct such objects based on a result set is PageSelectQueryBuilder.

Replacing TitleArray with a functionally equivalent usages of PageSelectQueryBuilder is simple enough; However, TitleArray is often use as a return type hint:

> ack '@return TitleArray' includes/
172:	 * @return TitleArrayFromResult
521:	 * @return TitleArray

276:	 * @return TitleArray TitleArray object for category members.

1180:	 * @return TitleArray|Title[]

215:	 * @return TitleArray|Title[]

3516:	 * @return TitleArray

3071:	 * @return TitleArray|array TitleArray, or empty array if this page's namespace

40:	 * @return TitleArrayFromResult

A quick survey of callers indicates that we could probably change the return type to iterable<Title> without breaking anything. However, we really want to go to iterable<PageIdentity> or PageIdentity[], which probably means deprecating and replacing the relevant methods.