Represents a page that is a potential link target. More...
Public Member Functions | |
canBeLinked () | |
Determines whether or not this page may be linked to. More... | |
hasDesiredNamespace () | |
Determines whether the Source is in a desired namespace, i.e. More... | |
hasNoAutolinksMagicWord () | |
Determines whether the source page contains the NOAUTOLINKS magic word. More... | |
getTitle () | |
Gets the title. More... | |
getNamespace () | |
Gets the namespace of the source Title. More... | |
getContent () | |
Gets the Content object for the source page. More... | |
hasContent () | |
Determines whether the source page has content. More... | |
getText () | |
Gets the text of the corresponding Wiki page. More... | |
setText ($text) | |
Unserializes text to the page's content. More... | |
getPage () | |
Returns the source page object. More... | |
Static Public Member Functions | |
static | createFromTitle (\Title $title, Config $config) |
Creates a Source object from a . More... | |
static | createFromTitleAndText (\Title $title, $text, Config $config) |
Creates a Source object with a given Title and a text. More... | |
static | createFromPageandContent (\WikiPage $page,\Content $content, Config $config) |
Creates a Source object with a given WikiPage and a Content. More... | |
static | createFromParser (\Parser $parser, Config $config) |
Creates a Source object with a given Parser. More... | |
static | createFromParserAndText (\Parser $parser, $text, Config $config) |
Creates a Source object with a given Parser and text. More... | |
Public Attributes | |
$config | |
The LinKTitles configuration for this Source. | |
Private Member Functions | |
__construct (Config $config) | |
Private constructor. More... | |
Private Attributes | |
$title | |
$text | |
$page | |
$content | |
Represents a page that is a potential link target.
Definition at line 29 of file Source.php.
|
private |
Private constructor.
Use one of the factories to created a Source object.
Config | $config | LinkTitles configuration |
Definition at line 125 of file Source.php.
LinkTitles\Source::canBeLinked | ( | ) |
Determines whether or not this page may be linked to.
Definition at line 133 of file Source.php.
|
static |
Creates a Source object with a given WikiPage and a Content.
This factory can be called e.g. from an onPageContentSave event handler which knows both these parameters.
\WikiPage | $page | WikiPage to link from |
\Content | $content | Page content |
Config | $config | LinkTitles configuration |
Definition at line 84 of file Source.php.
|
static |
|
static |
Creates a Source object with a given Parser and text.
This factory can be called e.g. from an onInternalParseBeforeLinks event handler which knows these parameters.
\Parser | $parser | Parser object from which to create the Source. |
String | $text | String representation of the page content. |
Config | $config | LinKTitles Configuration |
Definition at line 115 of file Source.php.
|
static |
|
static |
Creates a Source object with a given Title and a text.
This factory can be called e.g. from a onPageContentSave event handler which knows both these parameters.
\Title | $title | Title of the source page |
String | $text | String representation of the page content |
Config | $config | LinkTitles configuration |
Definition at line 67 of file Source.php.
LinkTitles\Source::getContent | ( | ) |
Gets the Content object for the source page.
The value is cached.
Definition at line 187 of file Source.php.
LinkTitles\Source::getNamespace | ( | ) |
Gets the namespace of the source Title.
Definition at line 176 of file Source.php.
LinkTitles\Source::getPage | ( | ) |
Returns the source page object.
Definition at line 234 of file Source.php.
LinkTitles\Source::getText | ( | ) |
Gets the text of the corresponding Wiki page.
The value is cached.
Definition at line 210 of file Source.php.
LinkTitles\Source::getTitle | ( | ) |
LinkTitles\Source::hasContent | ( | ) |
Determines whether the source page has content.
Definition at line 199 of file Source.php.
LinkTitles\Source::hasDesiredNamespace | ( | ) |
Determines whether the Source is in a desired namespace, i.e.
a namespace that is listed in the sourceNamespaces config setting or is NS_MAIN.
Definition at line 142 of file Source.php.
LinkTitles\Source::hasNoAutolinksMagicWord | ( | ) |
Determines whether the source page contains the NOAUTOLINKS magic word.
Definition at line 151 of file Source.php.
LinkTitles\Source::setText | ( | $text | ) |
Unserializes text to the page's content.
String | $text | Text to unserialize. |
Definition at line 224 of file Source.php.