Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | List of all members
SMW\PropertyAliasFinder Class Reference

Public Member Functions

 __construct (Cache $cache, array $propertyAliases=[], array $canonicalPropertyAliases=[])
 
 setContentLanguageCode ( $contentLanguageCode)
 
 getKnownPropertyAliases ()
 
 getKnownPropertyAliasesWithMsgKey ()
 
 getKnownPropertyAliasesByLanguageCode ( $languageCode='en')
 
 registerAliasByFixedLabel ( $id, $label)
 
 registerAliasByMsgKey ( $id, $msgKey)
 
 findCanonicalPropertyAliasById ( $id)
 
 findPropertyAliasById ( $id)
 
 findPropertyIdByAlias ( $alias)
 

Public Attributes

const CACHE_NAMESPACE = 'smw:property:alias'
 
const CACHE_TTL = 604800
 

Detailed Description

GNU GPL v2

Since
2.4
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\PropertyAliasFinder::__construct ( Cache  $cache,
array  $propertyAliases = [],
array  $canonicalPropertyAliases = [] 
)
Since
2.4
Parameters
Cache$cache
array$propertyAliases
array$canonicalPropertyAliases

Member Function Documentation

◆ findCanonicalPropertyAliasById()

SMW\PropertyAliasFinder::findCanonicalPropertyAliasById (   $id)
Since
2.4
Parameters
string$id
Returns
string|boolean

◆ findPropertyAliasById()

SMW\PropertyAliasFinder::findPropertyAliasById (   $id)
Since
2.4
Parameters
string$id
Returns
string|boolean

◆ findPropertyIdByAlias()

SMW\PropertyAliasFinder::findPropertyIdByAlias (   $alias)

Find and return the ID for the pre-defined property of the given local label. If the label does not belong to a pre-defined property, return false.

Parameters
string$alias
Returns
string|boolean

◆ getKnownPropertyAliases()

SMW\PropertyAliasFinder::getKnownPropertyAliases ( )
Since
2.4
Returns
array

◆ getKnownPropertyAliasesByLanguageCode()

SMW\PropertyAliasFinder::getKnownPropertyAliasesByLanguageCode (   $languageCode = 'en')
Since
3.0
Parameters
string$languageCode
Returns
array

◆ getKnownPropertyAliasesWithMsgKey()

SMW\PropertyAliasFinder::getKnownPropertyAliasesWithMsgKey ( )
Since
2.4
Returns
array

◆ registerAliasByFixedLabel()

SMW\PropertyAliasFinder::registerAliasByFixedLabel (   $id,
  $label 
)

Add a new alias label to an existing property ID. Note that every ID should have a primary label.

Parameters
string$idstring
string$label

◆ registerAliasByMsgKey()

SMW\PropertyAliasFinder::registerAliasByMsgKey (   $id,
  $msgKey 
)

Register an alias using a message key to allow fetching localized labels dynamically.

Since
2.4
Parameters
string$id
string$msgKey

◆ setContentLanguageCode()

SMW\PropertyAliasFinder::setContentLanguageCode (   $contentLanguageCode)
Since
3.1
Parameters
string$contentLanguageCode

Member Data Documentation

◆ CACHE_NAMESPACE

const SMW\PropertyAliasFinder::CACHE_NAMESPACE = 'smw:property:alias'

Identifies the cache namespace

◆ CACHE_TTL

const SMW\PropertyAliasFinder::CACHE_TTL = 604800

Identifies the cache TTL (one week)


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

About | General disclaimer | Privacy policy