new DAO(nm, module)
A SnoozeJS DAO
Parameters:
Name | Type | Description |
---|---|---|
nm |
string | The name of the DAO |
module |
object | The module the DAO will belong to |
Methods
-
(inner) getBelongsTo() → {string}
-
Gets the name of the DAO this DAO belongs to
Returns:
a DAO name (or null)- Type
- string
-
(inner) getFields() → {array}
-
Gets the fields of the DAO
Returns:
Gets an array of defined fields- Type
- array
-
(inner) getName() → {string}
-
Gets the name of the DAO
Returns:
The name of the DAO- Type
- string
-
(inner) getOneToMany() → {array}
-
Gets the name of DAOs this DAO has a one-to-many connection with
Returns:
an array of DAO names- Type
- array
-
(inner) getOneToOne() → {array}
-
Gets the name of DAOs this DAO has a one-to-one connection with
Returns:
an array of DAO names- Type
- array
-
(inner) getOptions() → {array}
-
Gets the options of the DAO
Returns:
Gets an array of defined options- Type
- array
-
(inner) getSeqDAO() → {object}
-
Gets the Sequelize Model this DAO is associated with
Returns:
Sequelize Model- Type
- object
-
(inner) setBelongsTo(val)
-
Sets the DAO this DAO belongs to
Parameters:
Name Type Description val
string The name of a DAO -
(inner) setFields(fields)
-
Sets the fields for this DAO
Parameters:
Name Type Description fields
array An array of field objects -
(inner) setOneToMany(vals)
-
Sets the DAOs this DAO has a one-to-many relation with
Parameters:
Name Type Description vals
array An array of DAO names -
(inner) setOneToOne(vals)
-
Sets the DAOs this DAO has a one-to-one relation with
Parameters:
Name Type Description vals
array An array of DAO names -
(inner) setOptions(options)
-
Sets the options for this DAO Options can contain belongsTo, oneToOne, and oneToMany
Parameters:
Name Type Description options
object an object of DAO options -
(inner) setSeqDAO(DAO)
-
Sets the Sequelize Model this DAO is associated with
Parameters:
Name Type Description DAO
object A Sequelize Model