|
| __construct (DataTypeRegistry $datatypeRegistry, PropertyLabelFinder $propertyLabelFinder, PropertyAliasFinder $propertyAliasFinder, array $dataTypePropertyExemptionList=[]) |
|
| getPropertyList () |
|
| getKnownPropertyAliases () |
|
| registerProperty ( $id, $valueType, $label=false, $isVisible=false, $isAnnotable=true, $isDeclarative=false) |
|
| registerPropertyAlias ( $id, $label) |
|
| registerPropertyAliasByMsgKey ( $id, $msgKey) |
|
| registerPropertyDescriptionByMsgKey ( $id, $msgKey) |
|
| registerPropertyDescriptionMsgKeyById ( $id, $msgKey) |
|
| findPropertyDescriptionMsgKeyById ( $id) |
|
| findPropertyLabelById ( $id) |
|
| findCanonicalPropertyLabelById ( $id) |
|
| findPropertyLabelFromIdByLanguageCode ( $id, $languageCode='') |
|
| findPropertyLabel ( $id) |
|
| getPropertyValueTypeById ( $id) |
|
| getPropertyTypeId ( $id) |
|
| getPredefinedPropertyTypeId ( $id) |
|
| findPropertyIdByLabel ( $label, $useAlias=true) |
|
| findPropertyIdFromLabelByLanguageCode ( $label, $languageCode='') |
|
| findPreferredPropertyLabelFromIdByLanguageCode ( $id, $languageCode='') |
|
| findPropertyId ( $label, $useAlias=true) |
|
| isKnownPropertyId ( $id) |
|
| isRegistered ( $id) |
|
| isVisible ( $id) |
|
| isAnnotable ( $id) |
|
| isDeclarative ( $id) |
|
GNU GPL v2+
- Since
- 2.1
- Author
- mwjames
-
Markus Krötzsch
◆ __construct()
◆ clear()
static SMW\PropertyRegistry::clear |
( |
| ) |
|
|
static |
◆ findCanonicalPropertyLabelById()
SMW\PropertyRegistry::findCanonicalPropertyLabelById |
( |
|
$id | ) |
|
- Since
- 2.4
- Parameters
-
- Returns
- string|bool
◆ findPreferredPropertyLabelFromIdByLanguageCode()
SMW\PropertyRegistry::findPreferredPropertyLabelFromIdByLanguageCode |
( |
|
$id, |
|
|
|
$languageCode = '' |
|
) |
| |
- Since
- 2.5
- Parameters
-
string | $id | |
string | null | $languageCode | |
- Returns
- string
◆ findPropertyDescriptionMsgKeyById()
SMW\PropertyRegistry::findPropertyDescriptionMsgKeyById |
( |
|
$id | ) |
|
- Since
- 2.5
- Parameters
-
- Returns
- string
◆ findPropertyId()
SMW\PropertyRegistry::findPropertyId |
( |
|
$label, |
|
|
|
$useAlias = true |
|
) |
| |
◆ findPropertyIdByLabel()
SMW\PropertyRegistry::findPropertyIdByLabel |
( |
|
$label, |
|
|
|
$useAlias = true |
|
) |
| |
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 | $label | normalized property label |
boolean | $useAlias | determining whether to check if the label is an alias |
- Returns
- mixed string property ID or false
◆ findPropertyIdFromLabelByLanguageCode()
SMW\PropertyRegistry::findPropertyIdFromLabelByLanguageCode |
( |
|
$label, |
|
|
|
$languageCode = '' |
|
) |
| |
- Since
- 2.4
- Parameters
-
string | $label | |
string | $languageCode | |
- Returns
- mixed string property ID or false
◆ findPropertyLabel()
SMW\PropertyRegistry::findPropertyLabel |
( |
|
$id | ) |
|
◆ findPropertyLabelById()
SMW\PropertyRegistry::findPropertyLabelById |
( |
|
$id | ) |
|
Get the translated user label for a given internal property ID. Returns empty string for properties without a translation (these are usually internal, generated by SMW but not shown to the user).
- Note
- An empty string is returned for incomplete translation (language bug) or deliberately invisible property
- Since
- 2.1
- Parameters
-
- Returns
- string
◆ findPropertyLabelFromIdByLanguageCode()
SMW\PropertyRegistry::findPropertyLabelFromIdByLanguageCode |
( |
|
$id, |
|
|
|
$languageCode = '' |
|
) |
| |
- Since
- 2.5
- Parameters
-
string | $id | |
string | $languageCode | |
- Returns
- string
◆ getInstance()
static SMW\PropertyRegistry::getInstance |
( |
| ) |
|
|
static |
◆ getKnownPropertyAliases()
SMW\PropertyRegistry::getKnownPropertyAliases |
( |
| ) |
|
◆ getPredefinedPropertyTypeId()
SMW\PropertyRegistry::getPredefinedPropertyTypeId |
( |
|
$id | ) |
|
- Deprecated:
- since 2.1 use getPropertyValueTypeById instead
◆ getPropertyList()
SMW\PropertyRegistry::getPropertyList |
( |
| ) |
|
◆ getPropertyTypeId()
SMW\PropertyRegistry::getPropertyTypeId |
( |
|
$id | ) |
|
◆ getPropertyValueTypeById()
SMW\PropertyRegistry::getPropertyValueTypeById |
( |
|
$id | ) |
|
Get the type ID of a predefined property, or '' if the property is not predefined. The function is guaranteed to return a type ID for keys of properties where isUserDefined() returns false.
- Parameters
-
- Returns
- string
◆ initProperties()
SMW\PropertyRegistry::initProperties |
( |
array |
$propertyList | ) |
|
|
protected |
- Note
- All ids must start with underscores. The translation for each ID, if any, is defined in the language files. Properties without translation cannot be entered by or displayed to users, whatever their "show" value below.
◆ isAnnotable()
SMW\PropertyRegistry::isAnnotable |
( |
|
$id | ) |
|
- Since
- 3.0
- Parameters
-
- Returns
- boolean
◆ isDeclarative()
SMW\PropertyRegistry::isDeclarative |
( |
|
$id | ) |
|
- Since
- 3.0
- Parameters
-
- Returns
- boolean
◆ isKnownPropertyId()
SMW\PropertyRegistry::isKnownPropertyId |
( |
|
$id | ) |
|
◆ isRegistered()
SMW\PropertyRegistry::isRegistered |
( |
|
$id | ) |
|
- Since
- 2.1
- Parameters
-
- Returns
- boolean
◆ isVisible()
SMW\PropertyRegistry::isVisible |
( |
|
$id | ) |
|
- Since
- 2.1
- Parameters
-
- Returns
- boolean
◆ registerProperty()
SMW\PropertyRegistry::registerProperty |
( |
|
$id, |
|
|
|
$valueType, |
|
|
|
$label = false , |
|
|
|
$isVisible = false , |
|
|
|
$isAnnotable = true , |
|
|
|
$isDeclarative = false |
|
) |
| |
A method for registering/overwriting predefined properties for SMW. It should be called from within the hook 'smwInitProperties' only. IDs should start with three underscores "___" to avoid current and future confusion with SMW built-ins.
- Parameters
-
string | $id | |
string | $valueType | SMW type id |
string | bool | $label | user label or false (internal property) |
boolean | $isVisible | only used if label is given, see isShown() |
boolean | $isAnnotable | |
boolean | $isDeclarative | |
◆ registerPropertyAlias()
SMW\PropertyRegistry::registerPropertyAlias |
( |
|
$id, |
|
|
|
$label |
|
) |
| |
Add a new alias label to an existing property ID. Note that every ID should have a primary label, either provided by SMW or registered with registerProperty().
- Parameters
-
$id | string id of a property |
$label | string alias label for the property |
- Note
- Always use registerProperty() for the first label. No property that has used "false" for a label on registration should have an alias.
◆ registerPropertyAliasByMsgKey()
SMW\PropertyRegistry::registerPropertyAliasByMsgKey |
( |
|
$id, |
|
|
|
$msgKey |
|
) |
| |
Register an alias using a message key to allow fetching localized labels dynamically (for when the user language is changed etc).
- Since
- 2.4
- Parameters
-
◆ registerPropertyDescriptionByMsgKey()
SMW\PropertyRegistry::registerPropertyDescriptionByMsgKey |
( |
|
$id, |
|
|
|
$msgKey |
|
) |
| |
Register a description message key for allowing it to be displayed in a localized context.
- Since
- 2.5
- Parameters
-
◆ registerPropertyDescriptionMsgKeyById()
SMW\PropertyRegistry::registerPropertyDescriptionMsgKeyById |
( |
|
$id, |
|
|
|
$msgKey |
|
) |
| |
The documentation for this class was generated from the following file:
- SemanticMediaWiki/src/PropertyRegistry.php