Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Services\EntityId\EscapingEntityIdFormatter Class Reference

EscapingEntityIdFormatter wraps another EntityIdFormatter and applies a transformation (escaping) to that formatter's output. More...

+ Inheritance diagram for Wikibase\DataModel\Services\EntityId\EscapingEntityIdFormatter:
+ Collaboration diagram for Wikibase\DataModel\Services\EntityId\EscapingEntityIdFormatter:

Public Member Functions

 __construct (EntityIdFormatter $formatter, $escapeCallback)
 
 formatEntityId (EntityId $value)
 

Private Attributes

 $formatter
 
 $escapeCallback
 

Detailed Description

EscapingEntityIdFormatter wraps another EntityIdFormatter and applies a transformation (escaping) to that formatter's output.

Since
1.1
Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Services\EntityId\EscapingEntityIdFormatter::__construct ( EntityIdFormatter $formatter,
$escapeCallback )
Parameters
EntityIdFormatter$formatterA formatter returning plain text.
callable$escapeCallbackA callable taking plain text and returning escaped text.
Exceptions
InvalidArgumentException

Member Function Documentation

◆ formatEntityId()

Wikibase\DataModel\Services\EntityId\EscapingEntityIdFormatter::formatEntityId ( EntityId $value)
See also
EntityIdFormatter::formatEntityId
Parameters
EntityId$value
Returns
string Typically wikitext or HTML, depending on the $escapeCallback provided.

Implements Wikibase\DataModel\Services\EntityId\EntityIdFormatter.

Member Data Documentation

◆ $escapeCallback

Wikibase\DataModel\Services\EntityId\EscapingEntityIdFormatter::$escapeCallback
private

◆ $formatter

Wikibase\DataModel\Services\EntityId\EscapingEntityIdFormatter::$formatter
private

The documentation for this class was generated from the following file: