Hi all,
I'm writing an extension. I hope to return customized user's display_name.
So, I listen to GetModelRelationship::class event to add a relation to user, named facebookUser
, the facebookUser
stores user nickname in facebook.
I also listen to GetDisplayName::class event to return customized display_name.
It works.
But it will execute sql several times according to the amount of the user will be returned.
I wonder if there's a way to eager load facebookUser
after users are loaded and before display_name is accessed.