The EagerBase provides a scaffold for handling with eager relation
pairing, by queueing the appropriate related method calls with
a database specific eagerFetch
method, which then may utilize
pushModels
for pairing the models depending on the database need.
This helper function is used internally to determine which relations
are necessary for fetching based on the model.load
or withRelated
option.
Internal flag to determine whether to set the ctor(s) on the Relation
object.
Eager load each of the withRelated
relation item, splitting on '.'
which indicates a nested eager load.
Add additional eager items to an array, to load at the next level in the query.
Only allow one of a certain nested type per-level.
Delete the internal flag from the model.
Fetch all eager loaded models, loading them onto an array of pending deferred objects, which will handle all necessary pairing with parent objects, etc.
Return a deferred handler for all of the nested object sync returning the original response when these syncs & pairings are complete.
Prep the withRelated
object, to normalize into an object where each
has a function that is called when running the query.
Pushes each of the incoming models onto a new related
array,
which is used to correcly pair additional nested relations.
Eager Base