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. -
(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 -
(inner) $init()
-
Initializes the instance _values with defaults
-
(inner) $startNewInstance()
-
Initializes instance values to an empty object
-
(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 Returns:
The exception (or null)- Type
- object