Vo
Value Object
Static Member Summary
Static Public Members | ||
public static get |
primaryKey: String: * Get the primary key name |
Static Method Summary
Static Public Methods | ||
public static |
assumePropertyExists(property: String) Check if a Vo property exists, else throw an Error |
|
public static |
getPropertiesNames(): String[] Get a list of all the properies of the Vo |
|
public static |
getPropertyConfig(property: String): Object Get all configuration of a property |
|
public static |
getPropertyDefault(property: String): String Get the default value of a property according to config |
|
public static |
getPropertyType(property: String): String Get the type of a property according to config |
|
public static |
hasProperty(property: String): boolean Check if a Vo property exists |
Constructor Summary
Public Constructor | ||
public |
constructor(data: Object) |
Member Summary
Public Members | ||
public |
data: * |
|
public get |
Get the cleaned dto |
|
public get |
Get the id as string |
|
public get |
Is the object unsaved (exist in storage but has changed) ? |
|
public get |
Is the object new (not saved) ? |
|
public get |
Is the object saved in storage ? |
|
public get |
Status (from Vo.STATUS values: 'new', 'changed' or 'saved') |
|
public set |
status(value: any): * To make sure status cannot be access in public |
Method Summary
Public Methods | ||
public |
castVoPropertyValue(key: String, value: any): any Cast a Vo property and return property well formated |
|
public |
Property getter |
|
public |
resetData(): self Reset all vo data |
|
public |
Property setter |
|
public |
Multi property setting |
Protected Methods | ||
protected |
statusChangeTrigger(previousStatus: String, newStatus: String) Method triggered when status change. |
Static Public Members
Static Public Methods
public static assumePropertyExists(property: String) source
Check if a Vo property exists, else throw an Error
Params:
Name | Type | Attribute | Description |
property | String | the property name |
public static getPropertyConfig(property: String): Object source
Get all configuration of a property
Params:
Name | Type | Attribute | Description |
property | String | the property name |
public static getPropertyDefault(property: String): String source
Get the default value of a property according to config
Params:
Name | Type | Attribute | Description |
property | String | the property name |
Public Constructors
Public Members
public data: * source
Public Methods
public castVoPropertyValue(key: String, value: any): any source
Cast a Vo property and return property well formated
Params:
Name | Type | Attribute | Description |
key | String | the property name |
|
value | any | the property value to cast |
Return:
any | the cast property |
public get(key: string, defaultValue: any): any source
Property getter
Params:
Name | Type | Attribute | Description |
key | string | the property name |
|
defaultValue | any |
|
the default value if the property is not set |
Return:
any |
public set(key: string, value: any): self source
Property setter
Params:
Name | Type | Attribute | Description |
key | string | the property name |
|
value | any | the value to assign |
Return:
self |
public setData(data: Object): self source
Multi property setting
Params:
Name | Type | Attribute | Description |
data | Object | associated key value object |
Return:
self |