new TransferContext(properties, getValue, setValue)
Creates a new transfer context object. Warning: Transfer context objects are created in models internally. They are intended only to make publicly available the values of model properties for custom transfer objects.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
properties |
Array.<bo.shared.PropertyInfo> |
<optional> |
An array of property definitions. |
getValue |
internal~getValue |
<optional> |
A function that returns the current value of a property. |
setValue |
internal~setValue |
<optional> |
A function that changes the current value of a property. |
Throws:
-
Argument error: The properties must be an array of PropertyInfo objects, or a single PropertyInfo object or null.
-
Argument error: The getValue argument must be a function.
-
Argument error: The setValue argument must be a function.
Members
-
<readonly> properties :Array.<bo.shared.PropertyInfo>
-
Array of property definitions that may appear on the transfer object.
Type:
- Array.<bo.shared.PropertyInfo>
Methods
-
getValue(propertyName) → {*}
-
Gets the current value of a model property.
Parameters:
Name Type Description propertyName
string The name of the property.
Throws:
-
Argument error: The name must be a non-empty string.
-
Argument error: The model has no property with the given name.
Returns:
The value of a model property.
- Type
- *
-
-
setValue(propertyName, value)
-
Sets the current value of a model property.
Parameters:
Name Type Description propertyName
string The name of the property.
value
* The new value of the property.
Throws:
-
Argument error: The name must be a non-empty string.
-
Argument error: The model has no property with the given name.
-