Public Member Functions | |
__construct () | |
Constructor (currently empty). | |
seed ($article_ids, $categories, $mode="AND") | |
Initializes the instance. | |
run () | |
Iterates through the parent tree starting with the seed values, then checks the articles if they match the conditions. | |
check ($id, &$conds, $path=array()) | |
This functions recurses through the parent representation, trying to match the conditions. | |
scan_next_layer () | |
Scans a "parent layer" of the articles/categories in $this->next. | |
Public Attributes | |
$articles = array () | |
$deadend = array () | |
$parents = array () | |
$next = array () | |
$targets = array () | |
$name2id = array () | |
$mode | |
$dbr |
). From this representation, it determines which of these articles are in one or all of a given subset of categories.
Example use : # Determines whether the article with the page_id 12345 is in both # "Category 1" and "Category 2" or their subcategories, respectively
$cf = new Categoryfinder ; $cf->seed ( array ( 12345 ) , array ( "Category 1","Category 2" ) , "AND" ) ; $a = $cf->run() ; print implode ( "," , $a ) ;
Definition at line 25 of file Categoryfinder.php.
Categoryfinder::__construct | ( | ) |
Categoryfinder::check | ( | $ | id, | |
&$ | conds, | |||
$ | path = array() | |||
) |
This functions recurses through the parent representation, trying to match the conditions.
$id | The article/category to check | |
$conds | The array of categories to match | |
$path | used to check for recursion loops |
Definition at line 94 of file Categoryfinder.php.
Categoryfinder::run | ( | ) |
Iterates through the parent tree starting with the seed values, then checks the articles if they match the conditions.
Definition at line 69 of file Categoryfinder.php.
Categoryfinder::scan_next_layer | ( | ) |
Scans a "parent layer" of the articles/categories in $this->next.
Definition at line 143 of file Categoryfinder.php.
Categoryfinder::seed | ( | $ | article_ids, | |
$ | categories, | |||
$ | mode = "AND" | |||
) |
Initializes the instance.
Do this prior to calling run().
$article_ids | Array of article IDs | |
$categories | FIXME | |
$mode | String: FIXME, default 'AND'. |
Definition at line 48 of file Categoryfinder.php.
Categoryfinder::$articles = array () |
Definition at line 27 of file Categoryfinder.php.
Categoryfinder::$dbr |
Definition at line 34 of file Categoryfinder.php.
Categoryfinder::$deadend = array () |
Definition at line 28 of file Categoryfinder.php.
Categoryfinder::$mode |
Definition at line 33 of file Categoryfinder.php.
Categoryfinder::$name2id = array () |
Definition at line 32 of file Categoryfinder.php.
Categoryfinder::$next = array () |
Definition at line 30 of file Categoryfinder.php.
Categoryfinder::$parents = array () |
Definition at line 29 of file Categoryfinder.php.
Categoryfinder::$targets = array () |
Definition at line 31 of file Categoryfinder.php.