Public Member Functions | |
| getName () | |
| getID () | |
| getPageCount () | |
| getSubcatCount () | |
| getFileCount () | |
| getTitle () | |
| getMembers ($limit=false, $offset= '') | |
| Fetch a TitleArray of up to $limit category members, beginning after the category sort key $offset. | |
| refreshCounts () | |
| Refresh the counts for this category. | |
Static Public Member Functions | |
| static | newFromName ($name) |
| Factory function. | |
| static | newFromTitle ($title) |
| Factory function. | |
| static | newFromID ($id) |
| Factory function. | |
| static | newFromRow ($row, $title=null) |
| Factory function, for constructing a Category object from a result set. | |
Protected Member Functions | |
| initialize () | |
| Set up all member variables using a database query. | |
Private Member Functions | |
| __construct () | |
| getX ($key) | |
| Generic accessor. | |
Private Attributes | |
| $mName = null | |
| Name of the category, normalized to DB-key form. | |
| $mID = null | |
| $mTitle = null | |
| Category page title. | |
| $mPages = null | |
| Counts of membership (cat_pages, cat_subcats, cat_files). | |
| $mSubcats = null | |
| $mFiles = null | |
If you call methods that change the database, like to refresh link counts, the objects will be appropriately reinitialized. Member variables are lazy-initialized.
TODO: Move some stuff from CategoryPage.php to here, and use that.
Definition at line 12 of file Category.php.
| Category::__construct | ( | ) | [private] |
Definition at line 21 of file Category.php.
| Category::getFileCount | ( | ) |
Definition at line 179 of file Category.php.
References getX().
| Category::getID | ( | ) |
Definition at line 173 of file Category.php.
References getX().
| Category::getMembers | ( | $ | limit = false, |
|
| $ | offset = '' | |||
| ) |
Fetch a TitleArray of up to $limit category members, beginning after the category sort key $offset.
| $limit | integer | |
| $offset | string |
Definition at line 202 of file Category.php.
References $conds, $dbr, $offset, $options, getName(), TitleArray::newFromResult(), and wfGetDB().
| Category::getName | ( | ) |
Definition at line 171 of file Category.php.
References getX().
Referenced by getMembers().
| Category::getPageCount | ( | ) |
Definition at line 175 of file Category.php.
References getX().
| Category::getSubcatCount | ( | ) |
Definition at line 177 of file Category.php.
References getX().
| Category::getTitle | ( | ) |
Definition at line 184 of file Category.php.
References initialize(), and Title::makeTitleSafe().
| Category::getX | ( | $ | key | ) | [private] |
Generic accessor.
Definition at line 223 of file Category.php.
References $key, and initialize().
Referenced by getFileCount(), getID(), getName(), getPageCount(), and getSubcatCount().
| Category::initialize | ( | ) | [protected] |
Set up all member variables using a database query.
Definition at line 27 of file Category.php.
References $dbr, $row, $title, refreshCounts(), and wfGetDB().
Referenced by getTitle(), getX(), and refreshCounts().
| static Category::newFromID | ( | $ | id | ) | [static] |
Factory function.
| $id | Integer: a category id |
Definition at line 120 of file Category.php.
| static Category::newFromName | ( | $ | name | ) | [static] |
Factory function.
| $name | Array: A category name (no "Category:" prefix). It need not be normalized, with spaces replaced by underscores. |
Definition at line 86 of file Category.php.
References $name, $title, and Title::makeTitleSafe().
Referenced by CoreParserFunctions::pagesincategory(), and populateCategory().
| static Category::newFromRow | ( | $ | row, | |
| $ | title = null | |||
| ) | [static] |
Factory function, for constructing a Category object from a result set.
| $row | result set row, must contain the cat_xxx fields. If the fields are null, the resulting Category object will represent an empty category if a title object was given. If the fields are null and no title was given, this method fails and returns false. | |
| $title | optional title object for the category represented by the given row. May be provided if it is already known, to avoid having to re-create a title object later. |
Definition at line 136 of file Category.php.
Referenced by CategoryViewer::doCategoryQuery().
| static Category::newFromTitle | ( | $ | title | ) | [static] |
Factory function.
| $title | Title for the category page |
Definition at line 105 of file Category.php.
References $title.
Referenced by CategoryViewer::__construct(), and CategoryPage::hasViewableContent().
| Category::refreshCounts | ( | ) |
Refresh the counts for this category.
Definition at line 235 of file Category.php.
References $dbw, $result, initialize(), wfGetDB(), and wfReadOnly().
Referenced by initialize().
Category::$mFiles = null [private] |
Definition at line 19 of file Category.php.
Category::$mID = null [private] |
Definition at line 15 of file Category.php.
Category::$mName = null [private] |
Category::$mPages = null [private] |
Counts of membership (cat_pages, cat_subcats, cat_files).
Definition at line 19 of file Category.php.
Category::$mSubcats = null [private] |
Definition at line 19 of file Category.php.
Category::$mTitle = null [private] |
1.5.9