Member-only story
A spooky win in the braces war
One of the weirdest coincidences ever proving I was right.
There are many debates in programming style, outright religious wars over style of how to layout your code.
If you’re not a programmer, glad to see you here reading some stories from our world and yes, code really does look as weird as you’ve seen on TV and in the movies.
/**
Used to load a related selection.
Mainly called from dbTable::ensureRecordLoaded and dbTable::MakeTableValid.
It may seem a little backwards but think of the normal context of using this method.
We have already loaded a current record in the LHS of a relationship and now want the related
record or selection. Remember that OOFILE allows you to iterate a table without forcing
instantiation of relationships. Only when you refer to a related selection or specific
fields in a related record is the relationship instantiated.
There are three distinct cases dealt with by this method:
-# an M:N relationship, which is implemented by our member mMNlink.
-# a 1:1, 1:N or N:1 join relationship which is handled by
OOF_simpleRecordBackend::loadRelatedContextJoiningFromTo (normally via a search)
-# a 1:1, 1:N or N:1 pointer relationship using record OID's in a search or direct lookup
If mInverseField (ie: other side of relationship pointing to us) isRef() then
it contains a copy of the OID of a record in our table and we have a direct lookup (not
caring if this is 1:1 or N:1 situation).
Otherwise it is 1:N…