Timeline for Drupal function field_get_items vs user_load
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 4, 2014 at 0:16 | history | migrated | from stackoverflow.com (revisions) | ||
Feb 3, 2014 at 22:47 | comment | added | Pierre Buyle | Yes, there is an alternative which does not require querying the DB: field_attach_load(). If not usable, user_load_multiple() may load too much data but at least it will perform better since it reduces the number of DB queries required to retrieve the data (because it can uses queries for all user). | |
Feb 3, 2014 at 15:04 | comment | added | Muhammad Reda | I guess there's no alternative, as I told you that I had the same issue and I had to write a custom query | |
Feb 3, 2014 at 13:24 | comment | added | Niccolo | I guess you are the right answer then. Any advice on part (1) alternatives or part (2) caching | |
Feb 3, 2014 at 13:23 | vote | accept | Niccolo | ||
Feb 4, 2014 at 11:00 | |||||
Feb 3, 2014 at 11:51 | comment | added | Muhammad Reda | Unfortunately, it doesn't. You have to do it the hard way. | |
Feb 3, 2014 at 11:18 | comment | added | Niccolo | I don't hate user_load_multiple. In this case it has the same problem as user_load, in that I need one value and it is retrieving the larger user object. I can write a query to access the one value, I just hoped that Drupal would already ahve a way of doing this. | |
Feb 3, 2014 at 8:11 | history | answered | Muhammad Reda | CC BY-SA 3.0 |