Support

Home Forums Event Espresso Premium Model Querying for People Add-On Data

Model Querying for People Add-On Data

Posted: December 5, 2015 at 6:04 pm


Matt Anderson

December 5, 2015 at 6:04 pm

Hi, I am using some of the techniques shown in this page (http://developer.eventespresso.com/docs/model-querying/) to query data an use it in some customize Gravity Forms.

I would like to be able to access the data in the People Add-On module and also use it in my customized Gravity Forms. My problem is that I haven’t been able to come across any documentation or examples that might show how I can programmatically access this data.

For example, I am using

EEM_Event::instance()->get_one_by_ID( $eventID )

to load an event and then I access various data elements in the object hierarchy. I want to know if I can get to People Add-On data by event in the same way I get to DateTimes, Venues, etc.

If it is possible, can you provide an example that would help me get a starting point for querying People Add-On data associated with my events.

Thanks in advance for any help you can offer,
Matt


Tony

  • Support Staff

December 7, 2015 at 6:31 am

Hi Matt,

You can use:

EE_Registry::instance()->load_helper( 'People_View' );
$people = EEH_People_View::get_people_for_event();

Then loop through $people which will be an array of people assigned to the event. If you are already within the loop it will use the current post id, so the current event, if you need a specific events people you can pass the event ID in the same way you have above.

You can see this in action within the people add-on templates.

Take a look within /eea-people-addon/public/templates/content-espresso_events-people.php

Does that help?


Matt Anderson

December 7, 2015 at 3:07 pm

Thank you, that is what I needed to help move forward! Matt

The support post ‘Model Querying for People Add-On Data’ 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.

Event Espresso