Kartographer
Extension that adds maps to wiki pages
Loading...
Searching...
No Matches
Kartographer\State Class Reference

Stores information about map tags on page in ParserOutput. More...

+ Inheritance diagram for Kartographer\State:
+ Collaboration diagram for Kartographer\State:

Public Member Functions

 hasValidTags ()
 
 setValidTags ()
 
 hasBrokenTags ()
 
 setBrokenTags ()
 
 useMaplink ()
 Increment the number of maplinks by one.
 
 getMaplinks ()
 
 useMapframe ()
 Increment the number of mapframes by one.
 
 getMapframes ()
 
 addInteractiveGroups (array $groupIds)
 
 getInteractiveGroups ()
 
 addRequestedGroups (array $groupIds)
 
 getRequestedGroups ()
 
 getCounters ()
 
 setCounters (array $counters)
 
 addData ( $groupId, array $data)
 
 getData ()
 
 jsonSerialize ()
 

Static Public Member Functions

static getState (ParserOutput $output)
 Retrieves an instance of self from ParserOutput, if present.
 
static getOrCreate (ParserOutput $output)
 Retrieves an instance of self from ParserOutput if possible, otherwise creates a new instance.
 
static setState (ParserOutput $output, self $state)
 Stores an instance of self in the ParserOutput.
 
static newFromJson (array $data)
 

Public Attributes

const DATA_KEY = 'kartographer'
 

Detailed Description

Stores information about map tags on page in ParserOutput.

Member Function Documentation

◆ addData()

Kartographer\State::addData ( $groupId,
array $data )
Parameters
string$groupId
array$dataA JSON-serializable structure

◆ addInteractiveGroups()

Kartographer\State::addInteractiveGroups ( array $groupIds)
Parameters
string[]$groupIds

◆ addRequestedGroups()

Kartographer\State::addRequestedGroups ( array $groupIds)
Parameters
string[]$groupIds

◆ getCounters()

Kartographer\State::getCounters ( )
Returns
int[]

◆ getData()

Kartographer\State::getData ( )
Returns
array[] Associative key-value array, build up by {
See also
addData}

◆ getInteractiveGroups()

Kartographer\State::getInteractiveGroups ( )
Returns
string[]

◆ getMapframes()

Kartographer\State::getMapframes ( )
Returns
int Number of mapframes.

◆ getMaplinks()

Kartographer\State::getMaplinks ( )
Returns
int Number of maplinks.

◆ getOrCreate()

static Kartographer\State::getOrCreate ( ParserOutput $output)
static

Retrieves an instance of self from ParserOutput if possible, otherwise creates a new instance.

Parameters
ParserOutput$output
Returns
self

◆ getRequestedGroups()

Kartographer\State::getRequestedGroups ( )
Returns
int[] Group id => original index map (flipped version of addRequestedGroups)

◆ getState()

static Kartographer\State::getState ( ParserOutput $output)
static

Retrieves an instance of self from ParserOutput, if present.

Parameters
ParserOutput$output
Returns
self|null

◆ hasBrokenTags()

Kartographer\State::hasBrokenTags ( )
Returns
bool

◆ hasValidTags()

Kartographer\State::hasValidTags ( )
Returns
bool

◆ jsonSerialize()

Kartographer\State::jsonSerialize ( )
Returns
array A JSON serializable associative array

◆ newFromJson()

static Kartographer\State::newFromJson ( array $data)
static
Parameters
array$dataA JSON serializable associative array, as returned by jsonSerialize()
Returns
self

◆ setCounters()

Kartographer\State::setCounters ( array $counters)
Parameters
int[]$countersA JSON-serializable structure

◆ setState()

static Kartographer\State::setState ( ParserOutput $output,
self $state )
static

Stores an instance of self in the ParserOutput.

Parameters
ParserOutput$output
self$state

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