Class: Instance

$k. Instance

new $k.Instance(type, param, language, options) : $k.Instance

Create a new instance of the type

Name Type Description
type

Type or internal name

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

jsOptionsComment

Since:
  • 5.1.1
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

Represents an instance.

Returns:
Type Description
$k.Instance The created instance

Extends

Methods

copy() : $k.Instance

Create a copy of me

Throws:
Type Description
$k.exception.ObjectRemoved

If instance got obsolete on the way here

$k.exception.AccessDenied

If current user is not allowed to create a new instance of this instance's type

$k.exception.RuntimeError

If anything bad happens during copy

Returns:
Type Description
$k.Instance

copyProperties(propertyNames, target) : $k.Instance

Create copies of the named properties at the target

Name Type Description
propertyNames Array.<string>

PropertyTypes or internal names

target $k.Instance

Target object

Throws:
Type Description
$k.exception.RuntimeError

If anything bad happens during copy

Returns:
Type Description
$k.Instance

createExtension(type) : Array.<$k.Instance>

Create an extension of the given type

Name Type Description
type

Type or internal name

Throws:
Type Description
$k.exception.SchemaError

If "type" is not a possible extension

$k.exception.TypeError

If "type" is not a type or internal name

$k.exception.TransactionError

If no write transaction is active

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

domain() : $k.Domain

Returns the domain of the instance

Since:
  • 4.1.0
Returns:
Type Description
$k.Domain

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

Returns the extension instances

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

possibleExtensions() : Array.<$k.Type>

Returns all possible extension types

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

Intherited methods