Class $k.AttributeType

Represents a type of attributes

Class Summary
Constructor Attributes Constructor Name and Description
 

Method Summary

Class Detail

$k.AttributeType()

Method Detail

  • {$k.SemanticElement} elementAtValue(value, language)
    Returns the semantic element with an attribute of this type with the specified value, or undefined if there is either no such attribute or more than one
    Parameters:
    {string} value
    The value to search for
    {string} language Optional
    Language of the value. If not defined, the current language will be used. Ignored if the attribute is not translated
    Throws:
    {$k.exception.InvalidValue}
    If the value is not in the range of allowed values of the attribute
    Returns:
    {$k.SemanticElement}
  • {$k.SemanticElement[]} elementsAtValue(value, language)
    Returns all semantic elements with attributes of this types with the specified value
    Parameters:
    {string} value
    The value to search for
    {string} language Optional
    Language of the value. If not defined, the current language will be used. Ignored if the attribute is not translated
    Throws:
    {$k.exception.InvalidValue}
    If the value is not in the range of allowed values of the attribute
    Returns:
    {$k.SemanticElement[]}
  • {boolean} hasTranslatedValues()
    True if the attributes have translated values
    Returns:
    {boolean}
  • {string[]} translatedLanguages()
    Returns the possible translated languages as 3-letter codes (ISO639 2b). Empty if the attribute is not translated
    Returns:
    {string[]}
  • {$k.ValueRange} valueRange()
    Returns the range of the values of the attributes
    Returns:
    {$k.ValueRange}