MediaWiki
REL1_22
|
Category objects are immutable, strictly speaking. More...
Public Member Functions | |
getFileCount () | |
getID () | |
getMembers ($limit=false, $offset= '') | |
Fetch a TitleArray of up to $limit category members, beginning after the category sort key $offset. | |
getName () | |
getPageCount () | |
getSubcatCount () | |
getTitle () | |
refreshCounts () | |
Refresh the counts for this category. | |
Static Public Member Functions | |
static | newFromID ($id) |
Factory function. | |
static | newFromName ($name) |
Factory function. | |
static | newFromRow ($row, $title=null) |
Factory function, for constructing a Category object from a result set. | |
static | newFromTitle ($title) |
Factory function. | |
Public Attributes | |
$mFiles = null | |
$mSubcats = null | |
Protected Member Functions | |
initialize () | |
Set up all member variables using a database query. | |
Private Member Functions | |
__construct () | |
getX ($key) | |
Generic accessor. | |
Private Attributes | |
$mID = null | |
$mName = null | |
Name of the category, normalized to DB-key form. | |
$mPages = null | |
Counts of membership (cat_pages, cat_subcats, cat_files) | |
Title | $mTitle = null |
Category page title. |
Category objects are immutable, strictly speaking.
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 31 of file Category.php.
Category::__construct | ( | ) | [private] |
Definition at line 42 of file Category.php.
Definition at line 218 of file Category.php.
Category::getID | ( | ) |
Definition at line 203 of file Category.php.
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 245 of file Category.php.
Definition at line 198 of file Category.php.
Definition at line 208 of file Category.php.
Definition at line 213 of file Category.php.
Definition at line 225 of file Category.php.
Referenced by CategoryViewer\addSubcategoryObject().
Category::getX | ( | $ | key | ) | [private] |
Category::initialize | ( | ) | [protected] |
Set up all member variables using a database query.
MWException |
Definition at line 50 of file Category.php.
static Category::newFromID | ( | $ | id | ) | [static] |
Factory function.
$id | Integer: a category id |
Definition at line 148 of file Category.php.
static Category::newFromName | ( | $ | name | ) | [static] |
Factory function.
array | $name | A category name (no "Category:" prefix). It need not be normalized, with spaces replaced by underscores. |
Definition at line 113 of file Category.php.
Referenced by PopulateCategory\doPopulateCategory(), and WikiPage\updateCategoryCounts().
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 | $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 164 of file Category.php.
static Category::newFromTitle | ( | $ | title | ) | [static] |
Factory function.
$title | Title for the category page |
Definition at line 133 of file Category.php.
Referenced by WikiCategoryPage\hasViewableContent(), InfoAction\pageInfo(), and CoreParserFunctions\pagesincategory().
Refresh the counts for this category.
Definition at line 293 of file Category.php.
Category::$mFiles = null |
Definition at line 40 of file Category.php.
Category::$mID = null [private] |
Definition at line 34 of file Category.php.
Category::$mName = null [private] |
Name of the category, normalized to DB-key form.
Definition at line 33 of file Category.php.
Category::$mPages = null [private] |
Counts of membership (cat_pages, cat_subcats, cat_files)
Definition at line 40 of file Category.php.
Category::$mSubcats = null |
Definition at line 40 of file Category.php.
Title Category::$mTitle = null [private] |
Category page title.
Definition at line 38 of file Category.php.