new DTO(nm, module)
A SnoozeJS DTO
Parameters:
Name | Type | Description |
---|---|---|
nm |
string | The name of the DTO |
module |
object | The module the DTO will belong to |
Methods
-
(inner) $get() → {object}
-
Inject function gets a DTO Instance
Returns:
A DTO Instance- Type
- object
-
(inner) addProperty(name)
-
Adds a new property to the DTO
Parameters:
Name Type Description name
string The name (or key) of the property -
(inner) getName() → {string}
-
Gets the name of the Controller
Returns:
The name of the Controller- Type
- string
-
(inner) getProperties() → {array}
-
Gets the defined properties
Returns:
Properties- Type
- array
-
(inner) isStrict(boolopt) → {boolean}
-
Sets or returns the strict mode of the DTO
Parameters:
Name Type Attributes Description bool
boolean <optional>
Optional boolean Returns:
If no bool param is defined returns true if the DTO is in strict mode- Type
- boolean
-
(inner) setMethods(methods)
-
Sets the custom methods for all DTO instances created from this DTO
Parameters:
Name Type Description methods
array An array of methods (post injection)