Class _Association
Base class for all associations.
NOT to be instantiated directly
Its just documented for reference.
Defined in: _Association.js.
Constructor Attributes | Constructor Name and Description |
---|---|
_Association(options)
|
Field Attributes | Field Name and Description |
---|---|
<static> |
_Association.fetch
Fetch types
|
Fetch type
|
|
Our filter method
|
|
The key on this models class to look up
|
|
the model associatied with this association.
|
|
how to order our association
|
|
The join key to look up on our associated model
|
Method Attributes | Method Name and Description |
---|---|
fetch(parent)
Filters and loads our association.
|
|
inject(parent, name)
Method to inject functionality into a model.
|
|
isEager()
|
Class Detail
_Association(options)
- Parameters:
- {Object} options
- {String} options.model
- a string to look up the model that we are associated with
- {Function} options.filter
- a callback to find association if a filter is defined then the association is read only
- {Object} options.key
- object with left key and right key
-
{String|Object} options.orderBy
- - how to order our association @see Dataset.order
- {fetch.EAGER|fetch.LAZY} options.fetchType
- the fetch type of the model if fetch.Eager is supplied then the associations are automatically filled, if fetch.Lazy is supplied then a promise is returned and is called back with the loaded models
Field Detail
<static>
_Association.fetch
Fetch types
fetchType
Fetch type
filter
Our filter method
leftKey
The key on this models class to look up
{Model}
model
the model associatied with this association.
orderBy
how to order our association
rightKey
The join key to look up on our associated model
Method Detail
{comb.Promise}
fetch(parent)
Filters and loads our association.
- Parameters:
- parent
- Returns:
- {comb.Promise} Called back with the associations.
inject(parent, name)
Method to inject functionality into a model. This method alters the model
to prepare it for associations, and initializes all required middleware calls
to fulfill requirements needed to loaded the associations.
- Parameters:
- {Model} parent
- the model that is having an associtaion set on it.
- {String} name
- the name of the association.
{Boolean}
isEager()
- Returns:
- {Boolean} true if the association is eager.