Class: InstanceType

$k. InstanceType

new $k.InstanceType()

Represents a type of instances

Extends

Methods

allInstances() : Array.<$k.Instance>

Returns all instances of this type and all subtypes.
Avoid using this function if possible, use queries instead

Returns:
Type Description
Array.<$k.Instance>

createInstance(param, language, options) : $k.Instance

Create a new instance of this type

Name Type Description
param string optional

The name of the new instance

language string optional

Language of the value. Either ISO 639-1 (2-letter code, e.g. "en") or ISO 639-2B (3-letter code, e.g. "eng"). If not defined, the current language will be used.
Ignored if the attribute is not translated

options object optional

Options


  • cluster: {$k.SemanticElement} Store the new instance the cluster of the element

Throws:
Type Description
$k.exception.SchemaError

If the type is abstract

$k.exception.AccessDenied

If creating an instance is not allowed

$k.exception.TransactionError

If no write transaction is active

Returns:
Type Description
$k.Instance The created instance

createSubtype(param, language) : $k.Type

Create a new subtype

Name Type Description
param string optional

The name of the new type

language string optional

Language of the value. Either ISO 639-1 (2-letter code, e.g. "en") or ISO 639-2B (3-letter code, e.g. "eng"). If not defined, the current language will be used.
Ignored if the attribute is not translated

Throws:
Type Description
$k.exception.SchemaError

If subtypes cannot be created

$k.exception.AccessDenied

If creating a subtype is not allowed

$k.exception.TransactionError

If no write transaction is active

Returns:
Type Description
$k.Type The created type

extendedTypes() : Array.<$k.InstanceType>

Returns the types that can be extended by this type or a subtype.
Does not check if this type allows to create extensions

See:
Returns:
Type Description
Array.<$k.InstanceType>

extensionTypes() : Array.<$k.InstanceType>

Returns the types that can extend instances of this type.
Does not check if these types allow to create extensions

See:
Returns:
Type Description
Array.<$k.InstanceType>

instances() : Array.<$k.Instance>

Returns all direct instances of this type.
Avoid using this function if possible, use queries instead

Returns:
Type Description
Array.<$k.Instance>

Intherited methods

addSupertype(type), allSubtypes(), allSupertypes(), attribute(type), attributes(type), attributeValue(type, language), attributeValueString(type, language), callBehaviour(method, args), canCreateExtensions(), canCreateInstances(), changeLog(), core(), createAttribute(type, value, language), createAttributeFromString(type, valueString, language), createRelation(type, target, inverse), domain(), element(), ensureAttributeValue(type, value, language), ensureRelationTarget(type, target, inverse), estimatedNumberOfInstances(), getCounter(), hasPossibleAttribute(type), hasPossibleRelation(type), icon(size, language), idNumber(), idString(), increaseCounter(), inheritedAttribute(type), inheritedAttributeValue(type, language), internalName(), isAbstract(), isKindOf(type), locatorString(locatorTypes), modificationNumber(), name(language), numberOfInstances(), possibleProperties(filter), primaryCore(), properties(filter), relation(type), relations(type), relationTarget(type), relationTargets(type), remove(), removeSupertype(), render(context, keyFilter, detailFilter), renderJSON(context, excludedKeys, detailFilter), renderTemplate(template, entity, conversion, variables), setAttributeFromString(type, valueString, language), setAttributeValue(type, value, language), setCanCreateExtensions(canCreate), setCanCreateInstances(canCreate), setCounter(counterValue), setInternalName(name), setName(name, language), setRelationTarget(type, target, inverse), subtypes(), supertypes(), type(), typeDomain(), updateMapping()