I’m having a similar issue. I was having the same issue with getAttributes() but I’m new and didn’t even realize that was an alternative to just using the ->attributes member of the AR class. Now, this fixes the issue with direct model lookups but I’m still having the same issue with related looks. I created two classes WIDGETS and SUBWIDGETS. WIDGETS have many SUBWIDGETS. SUBWIDGETS have a scope named “summary”. If i get
and then use
to retrieve the data it all works as planned but when I go to retrieve
it still selects all of the columns for SUBWIDGETS. Is there any way to just retrieve the summary data? Any help greatly appreciated.
After a bit more research I realize that the scope is actually working but when accessing the related data it still has all of the fields as attributes but the ones not selected in the scope are just left null. Is there any way to avoid having these attributes at all? Thanks!