Fetches potential target page titles from the database.
More...
|
| $queryResult |
| Holds the results of a database query for target page titles, filtered and sorted.
|
|
| $sourceNamespace |
| Holds the source page's namespace (integer) for which the list of target pages was built.
|
|
|
| __construct (\Title $title, Config $config) |
| The constructor is private to enforce using the singleton pattern. More...
|
|
| fetch () |
| Fetches the page titles from the database.
|
|
| charLength () |
|
|
| $config |
|
| $charLengthFunction |
| Stores the CHAR_LENGTH function to be used with the database connection.
|
|
Fetches potential target page titles from the database.
Definition at line 29 of file Targets.php.
LinkTitles\Targets::__construct |
( |
\Title |
$title, |
|
|
Config |
$config |
|
) |
| |
|
private |
The constructor is private to enforce using the singleton pattern.
- Parameters
-
Definition at line 87 of file Targets.php.
static LinkTitles\Targets::invalidate |
( |
| ) |
|
|
static |
Invalidates the cache; the next call of Targets::singleton() will trigger a database query.
Use this in unit tests which are performed in a single request cycle so that changes to the pages list may not be picked up by the cached Targets instance.
Definition at line 57 of file Targets.php.
static LinkTitles\Targets::singleton |
( |
\Title |
$title, |
|
|
Config |
$config |
|
) |
| |
|
static |
Singleton factory that returns a (cached) database query results with potential target page titles.
The subset of pages that may serve as target pages depends on the namespace of the source page. Therefore, if the $sourceNamespace differs from the cached namespace, the database is queried again.
- Parameters
-
String | $sourceNamespace | The namespace of the current page. |
Config | $config | LinkTitles configuration. |
Definition at line 43 of file Targets.php.
The documentation for this class was generated from the following file: