RSS Feed/News Best practices in using XF::finder

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,648
Points
823

Reputation:

This is a bit of a generic ask, but my add-on stores associated records to a user by user_id. When surfacing up information, is it proper to use $finder = \XF::finder('XF:User'); $user = $finder->where('user_id', 1)->fetchOne(); within a foreach loop to get the associated user's information?

If each finder for each user translates to a select * from xf_user table, that seems like a really expensive design / will hammer the database...

Read more

Continue reading...
 
Status
Not open for further replies.
Top