Posted: January 30, 2015 at 7:28 am
|
Hi! I’ve built a custom CSV exporter plugin for EE and now I’m trying to fetch all the answers of an attendee. I’ve found I have at my disposal the ATT_ID, REG_ID and of course the event ID (and sometimes a Ticket ID). I assume I can’t use the Any help here will be very appreciated! I know this is a bit beyond the regular “How do I show my events on the frontpage” support ticket ๐ |
This article we did on using the EE models for querying will probably be helpful: http://developer.eventespresso.com/docs/model-querying/. It sounds like you really want the **registration’s** answers, not the attendee’s. Keep in mind that a registration is a record for ONE attendee at ONE event. You said you already have the REG_ID so I think that’s all you’ll need. But the short answer: If you want to get all the answers for a particular attendee at ALL the events they’ve ever attended, you would run this similar query: |
|
|
Hi Mike, Thank you for that enlightening answer ๐ I did not know about this since last time i checked your in-progress site developer.* there wasn’t much there ๐ I have no problem fetching the record for one attendee at one event! Since I already have the attendees base info. Do I need to use your helper functions to be able to fetch the information from the EE_Answer objects (like for an event object) or can I access then directly? It’s really nice that you’re improving your documentation like this! A little feedback tho would be to more clearly link people to these articles (or just the developer. site in general) from your regular site. These kinds of articles are gold for a developer like me that needs to do custom functionality. D.S. |
re
Sorry I don’t totally understand. Do you mean you’re wondering if you need to use Does that answer your question? And yeah I’ll suggest we make the developer documentation more visible. |
|
|
sort of. I’m not used to the return object being an object with protected fields etc. so I have to run functions on this to fetch the values. But it worked out and I now have the question labels and answers per attendee per event. Now comes the next “challenge”. Since I’m building this as a XML where there need to be a “head” column at the top of each value I also need to fetch all the possible questions (regardless of attendee specific answers/non-answers) for an event. So that I can loop through them and output each question as a column of it’s own. Any ideas where to look (or possibly an answer straight out)? ๐ Another related question. How is this in terms of performance? It’s possible my client will want to export say 200-300 records at once and I’m afraid it will hit the server timed out limit with all these function calls and (I presume) queries. Thank you for all the help! It’s nice to see a support-forum where the staff actually have some technical knowledge |
I’d suggest looking at how we do the registrations report CSV in the file core/db_classes/EE_Export.class.php in the re
Creating all these objects and accessing all their properties via methods is convenient for developers but not terribly efficient. The objects do try to cache certain results from the queries they do behind-the-scenes (eg, calling |
|
The support post ‘Fetching all the answers for an attendee’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.