Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7478844
ExistenceLinksTable.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ExistenceLinksTable.php
View Options
<?php
// @phan-file-suppress PhanPluginNeverReturnMethod -- for getNamespaceField
namespace
MediaWiki\Deferred\LinksUpdate
;
use
MediaWiki\Parser\ParserOutput
;
use
MediaWiki\Parser\ParserOutputLinkTypes
;
/**
* References like {{#ifexist:Title}} that cause the parser output to change
* when the existence of the page changes, but are not shown in
* Special:WhatLinksHere.
*
* @since 1.45
*/
class
ExistenceLinksTable
extends
GenericPageLinksTable
{
public
const
VIRTUAL_DOMAIN
=
'virtual-existencelinks'
;
public
function
setParserOutput
(
ParserOutput
$parserOutput
)
{
$this
->
newLinks
=
[];
foreach
(
$parserOutput
->
getLinkList
(
ParserOutputLinkTypes
::
EXISTENCE
)
as
[
'link'
=>
$link
]
)
{
$this
->
newLinks
[
$link
->
getNamespace
()][
$link
->
getDBkey
()]
=
true
;
}
}
/** @inheritDoc */
protected
function
getTableName
()
{
return
'existencelinks'
;
}
/** @inheritDoc */
protected
function
getFromField
()
{
return
'exl_from'
;
}
/** @inheritDoc */
protected
function
getNamespaceField
()
{
throw
new
\LogicException
(
'This table has no namespace field'
);
}
/** @inheritDoc */
protected
function
getTitleField
()
{
throw
new
\LogicException
(
'This table has no title field'
);
}
/** @inheritDoc */
protected
function
getFromNamespaceField
()
{
return
null
;
}
/** @inheritDoc */
protected
function
getTargetIdField
()
{
return
'exl_target_id'
;
}
/** @inheritDoc */
protected
function
linksTargetNormalizationStage
():
int
{
return
SCHEMA_COMPAT_NEW
;
}
/** @inheritDoc */
protected
function
virtualDomain
():
string
{
return
self
::
VIRTUAL_DOMAIN
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 11:27 (4 d, 18 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a7/47/1279ffafde62ef9e35eaa3ffcd93
Default Alt Text
ExistenceLinksTable.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment