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. |
options |
object |
optional
Options
|
- 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
changeType(jseType, ignoreLossOfProperties) : boolean
Change type
Name | Type | Description |
---|---|---|
jseType |
Type or internal name |
|
ignoreLossOfProperties |
boolean |
optional
Ignore loss of properties; default: false |
- Since:
- 5.3.0
Returns:
Type | Description |
---|---|
boolean | True if properties have been lost |
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> |