class staticbo.shared. PropertyInfo
Source: shared/
Defines a property of a business object model.
Properties
Method
new PropertyInfo(name, type[, flags][, getter][, setter])
Creates a new property definition. The data type can be any one from the bo.dataTypes namespace or a custom data type based on DataType object, or can be any business object model or collection defined by the model types available in the bo namespace (i.e. models based on ModelBase or {@link bo.CollectionBase CollectionBase} objects). The flags parameter is ignored when data type is a model or collection.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
name |
string |
|
The name of the property. |
type |
any type |
|
The data type of the property. |
flags |
Yes |
Other attributes of the property. |
|
getter |
Yes |
Custom function to read the value of the property. |
|
setter |
Yes |
Custom function to write the value of the property. |
- Throws
-
Argument error: The name must be a non-empty string.
-
Argument error: The type must be a data type, a model or a collection.
-
Argument error: The flags must be PropertyFlag items.
Properties
read-onlygetter
external.propertyGetter
The custom getter function of the property.
read-onlyisKey
string
Indicates if the property is a key element.
read-onlyisOnCto
string
Indicates whether the value of the property would be passed to the client or would be received from the client, respectively.
read-onlyisOnDto
string
Indicates whether the value of the property would be passed to the data access object or would be received from the data access object, respectively.
read-onlyisParentKey
string
Indicates if the property is a key element of the parent object.
read-onlyisReadOnly
string
Indicates whether the value of the property can be modified.
read-onlyname
string
The name of the property.
read-onlysetter
external.propertySetter
The custom setter function of the property.
read-onlytype
any type
The data type of the property. The data type can be any one from the bo.dataTypes namespace or a custom data type based on DataType object, or can be any business object model or collection defined by the model types available in the bo namespace (i.e. models based on ModelBase or {@link bo.CollectionBase CollectionBase} objects).
Method
hasValue(value) → boolean
Checks if value has the appropriate type and it is not null, and not empty in case of Text data type.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
value |
data |
|
The value to check. |
- Returns
-
boolean
True if the value is neither null nor empty, otherwise false.