Class: HasManyThrough

HasManyThrough(definition, modelInstance) → {HasManyThrough}

HasManyThrough

Constructor

new HasManyThrough(definition, modelInstance) → {HasManyThrough}

HasManyThrough subclass
Parameters:
Name Type Description
definition RelationDefinition | Object
modelInstance Object
Source:
Returns:
Type
HasManyThrough

Methods

add(acInst, dataopt, optionsopt, cbopt)

Add the target model instance to the 'hasMany' relation
Parameters:
Name Type Attributes Description
acInst Object | ID The actual instance or id value
data Object <optional>
Optional data object for the through model to be created
options Object <optional>
Options
cb function <optional>
Callback function
Source:

destroyById(fkId, optionsopt, cb)

Delete a related item by foreign key
Parameters:
Name Type Attributes Description
fkId * The foreign key
options Object <optional>
Options
cb function The callback function
Source:

exists(acInst)

Check if the target model instance is related to the 'hasMany' relation
Parameters:
Name Type Description
acInst Object | ID The actual instance or id value
Source:

findById(fkId, optionsopt, cb)

Find a related item by foreign key
Parameters:
Name Type Attributes Description
fkId * The foreign key value
options Object <optional>
Options
cb function The callback function
Source:

remove({Object|ID))

Remove the target model instance from the 'hasMany' relation
Parameters:
Name Type Description
{Object|ID) acInst The actual instance or id value
Source: