Class: BelongsTo

BelongsTo(definition, modelInstance) → {BelongsTo}

BelongsTo

Constructor

new BelongsTo(definition, modelInstance) → {BelongsTo}

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

Methods

get(cb) → {Promise|Undefined}

Define a Promise-based method for the belongsTo relation itself - order.customer.get(cb): Load the target model instance asynchronously
Parameters:
Name Type Description
cb function Callback of the form function (err, inst)
Source:
Returns:
returns promise if callback is omitted
Type
Promise | Undefined
Define the method for the belongsTo relation itself It will support one of the following styles: - order.customer(refresh, options, callback): Load the target model instance asynchronously - order.customer(customer): Synchronous setter of the target model instance - order.customer(): Synchronous getter of the target model instance
Parameters:
Name Type Description
refresh
params
Source:
Returns:
Type
*