new PropertyFlag()
Creates a new object containing the property flag set.
Extends
Members
-
<readonly> $name :string
-
The name of the enumeration. The default value is the name of the constructor.
Type:
- string
- Inherited From:
-
<constant> key
-
The model property is a key element of the model.
- Default Value:
-
- 2
-
<constant> none
-
None of the property flags.
- Default Value:
-
- 0
-
<constant> notOnCto
-
The value of the model property will not be used on the client transfer object. Equivalent with PropertyFlag.onDtoOnly.
- Default Value:
-
- 16
-
<constant> notOnDto
-
The value of the model property will not be used on the data transfer object. Equivalent with PropertyFlag.onCtoOnly.
- Default Value:
-
- 8
-
<constant> onCtoOnly
-
The value of the model property will be used on the client transfer object only. Equivalent with PropertyFlag.notOnDto.
- Default Value:
-
- 8
-
<constant> onDtoOnly
-
The value of the model property will be used on the data transfer object only. Equivalent with PropertyFlag.notOnCto.
- Default Value:
-
- 16
-
<constant> parentKey
-
The model property is a key element of the parent model.
- Default Value:
-
- 4
-
<constant> readOnly
-
The model property cannot be set.
- Default Value:
-
- 1
Methods
-
check(value, message, messageParams)
-
Checks whether the enumeration has an item with the given value. If not, throws an error.
Parameters:
Name Type Argument Description value
number The value to check.
message
string <optional>
Human-readable description of the error.
messageParams
* <optional>
<repeatable>
Optional interpolation parameters of the message.
- Inherited From:
Throws:
Enumeration error: The passed value is not an enumeration item. -
count() → {number}
-
Returns the count of the items in enumeration.
- Inherited From:
Returns:
The count of the enumeration items.
- Type
- number
-
getName(value) → {string}
-
Returns the name of an enumeration item.
Parameters:
Name Type Description value
number The enumeration item that name to be returned of.
- Inherited From:
Throws:
-
Argument error: The value must be a number.
-
Enumeration error: The passed value is not an enumeration item.
Returns:
The name of the enumeration item.
- Type
- string
-
getValue(name) → {number}
-
Returns the value of an enumeration item based on its name.
Parameters:
Name Type Description name
string The enumeration item that value to be returned of.
- Inherited From:
Throws:
-
Argument error: The name must be a non-empty string.
-
Enumeration error: The passed name is not an enumeration item.
Returns:
The value of the enumeration item.
- Type
- number
-
hasMember(value) → {boolean}
-
Determines if the enumeration has an item with the given value.
Parameters:
Name Type Description value
number The value to check.
- Inherited From:
Returns:
True if the value is an enumeration item, otherwise false.
- Type
- boolean
-
hasValue(name) → {boolean}
-
Determines if the enumeration has an item with the given name.
Parameters:
Name Type Description name
string The name of the enumeration item.
- Inherited From:
Returns:
True if the name is an enumeration item, otherwise false.
- Type
- boolean