The current approach, especially for retrieving relationships, can be fraught with problems.
Line 89 of ModelReflectionHelper executes the relation method directly, which exposes execution to any and all exception throws, typos, etc. Whitelisting/blacklisting is currently applied after all fields, casts and relations are processed.
Best idea I've got at the moment is to apply getHidden/getVisible inside getModelClassMethods of the ModelReflectionHelper to (attempt to) obviate those calls.
The current approach, especially for retrieving relationships, can be fraught with problems.
Line 89 of ModelReflectionHelper executes the relation method directly, which exposes execution to any and all exception throws, typos, etc. Whitelisting/blacklisting is currently applied after all fields, casts and relations are processed.
Best idea I've got at the moment is to apply getHidden/getVisible inside getModelClassMethods of the ModelReflectionHelper to (attempt to) obviate those calls.