Class: DTOInstance

DTOInstance

new DTOInstance()

DTOInstance An instance of the defined DTO
Source:

Methods

(inner) $create(obj)

Creates a new DTO instance from the supplied JSON object.
Parameters:
Name Type Description
obj object A JSON object return {object} A JSON Object.
Source:

(inner) $defaults(obj)

Runs the provided data through the DTO applying the defaults. If the JSON object supplied has values for the defaults the defaults will not overwrite the existing values. Does not manipulate the instance itself.
Parameters:
Name Type Description
obj object A JSON object
Source:

(inner) $init()

Initializes the instance _values with defaults
Source:

(inner) $startNewInstance()

Initializes instance values to an empty object
Source:

(inner) $test(obj) → {object}

Tests if the JSON object is valid for the DTO. Returns an exception if unable to conver the JSON object to a DTO or null if no problems are found.
Parameters:
Name Type Description
obj object The JSON Objecct
Source:
Returns:
The exception (or null)
Type
object