MediaWiki
1.23.2
|
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. More... | |
getName () | |
getPageCount () | |
getSubcatCount () | |
getTitle () | |
refreshCounts () | |
Refresh the counts for this category. More... | |
Static Public Member Functions | |
static | newFromID ( $id) |
Factory function. More... | |
static | newFromName ( $name) |
Factory function. More... | |
static | newFromRow ( $row, $title=null) |
Factory function, for constructing a Category object from a result set. More... | |
static | newFromTitle ( $title) |
Factory function. More... | |
Public Attributes | |
$mFiles = null | |
$mSubcats = null | |
Protected Member Functions | |
initialize () | |
Set up all member variables using a database query. More... | |
Private Member Functions | |
__construct () | |
getX ( $key) | |
Generic accessor. More... | |
Private Attributes | |
$mID = null | |
$mName = null | |
Name of the category, normalized to DB-key form. More... | |
$mPages = null | |
Counts of membership (cat_pages, cat_subcats, cat_files) More... | |
Title | $mTitle = null |
Category page title. More... | |
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.
Definition at line 31 of file Category.php.
|
private |
Definition at line 42 of file Category.php.
Category::getFileCount | ( | ) |
Definition at line 232 of file Category.php.
References getX().
Category::getID | ( | ) |
Definition at line 211 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 259 of file Category.php.
References $dbr, $limit, $options, array(), DB_SLAVE, getName(), TitleArray\newFromResult(), wfGetDB(), wfProfileIn(), and wfProfileOut().
Category::getName | ( | ) |
Definition at line 204 of file Category.php.
References getX().
Referenced by getMembers().
Category::getPageCount | ( | ) |
Definition at line 218 of file Category.php.
References getX().
Category::getSubcatCount | ( | ) |
Definition at line 225 of file Category.php.
References getX().
Category::getTitle | ( | ) |
Definition at line 239 of file Category.php.
References $mTitle, initialize(), Title\makeTitleSafe(), and NS_CATEGORY.
Referenced by CategoryViewer\addSubcategoryObject().
|
private |
Generic accessor.
Definition at line 295 of file Category.php.
References initialize().
Referenced by getFileCount(), getID(), getName(), getPageCount(), and getSubcatCount().
|
protected |
Set up all member variables using a database query.
MWException |
Definition at line 50 of file Category.php.
References $dbr, array(), DB_SLAVE, refreshCounts(), wfGetDB(), wfProfileIn(), and wfProfileOut().
Referenced by getTitle(), getX(), and refreshCounts().
|
static |
Factory function.
$id | Integer: a category id |
Definition at line 149 of file Category.php.
|
static |
Factory function.
array | $name | A category name (no "Category:" prefix). It need not be normalized, with spaces replaced by underscores. |
Definition at line 114 of file Category.php.
References $name, $title, Title\makeTitleSafe(), and NS_CATEGORY.
Referenced by PopulateCategory\doPopulateCategory(), and WikiPage\updateCategoryCounts().
|
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 167 of file Category.php.
References $title.
Referenced by CategoryViewer\doCategoryQuery().
|
static |
Factory function.
$title | Title for the category page |
Definition at line 134 of file Category.php.
References $title.
Referenced by CategoryViewer\__construct(), WikiCategoryPage\hasViewableContent(), InfoAction\pageInfo(), CoreParserFunctions\pagesincategory(), and SpecialSearch\showHit().
Category::refreshCounts | ( | ) |
Refresh the counts for this category.
Definition at line 307 of file Category.php.
References $ret, array(), DB_MASTER, initialize(), NS_CATEGORY, NS_FILE, wfGetDB(), wfProfileIn(), wfProfileOut(), and wfReadOnly().
Referenced by initialize().
Category::$mFiles = null |
Definition at line 40 of file Category.php.
|
private |
Definition at line 34 of file Category.php.
|
private |
Name of the category, normalized to DB-key form.
Definition at line 33 of file Category.php.
|
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.
|
private |