Support

Home Forums Event Espresso Premium Field Names

Field Names

Posted: June 26, 2017 at 5:11 pm


TommyTrojan

June 26, 2017 at 5:11 pm

Hi,what is the database field name for the new Event Datetimes that are created on when making an event with multiple days? I want to put the name of those additional Event Datetimes on my event table page but need to know what name they are referenced by?


Tony

  • Support Staff

June 27, 2017 at 5:39 am

Hi there,

The datetimes are stored within the {prefix}_esp_datetime table, you’ll find all the fields within that table.

However it would be much better to use our models to pull the information you need, take a look here:

https://github.com/eventespresso/event-espresso-core/blob/master/docs/G–Model-System/model-querying.md

I’m assuming the event table is the table view template and that you have the EE_Event object?


TommyTrojan

June 27, 2017 at 10:38 am

Thank you, I will use the models. And to follow up, I am using the table view template, and I see that the column name for the field I am interested is titled DTT_name in the wp_esp_datetime table. However, when I use the models how do I reference that field, is that what you mean by EE_event object?


Tony

  • Support Staff

June 27, 2017 at 10:48 am

However, when I use the models how do I reference that field, is that what you mean by EE_event object?

The EE_Event object would be part of the models, it’s the object you would use to pull the details for the Event.

From that you can pull anything related to the event, such as datetimes.

Within the table view template you’ll already have this:

$event = EEH_Event_View::get_event();

Which pulls the EE_Event object for the current post into $event, a little further into the template you’ll also see:

$datetimes = EEM_Datetime::instance()->get_datetimes_for_event_ordered_by_start_time( $post->ID, $show_expired, false, $datetime_limit );

Which, as the name suggest pulls all of the datetimes for the current post (event) order by start date/time.

$datetimes is then an array of EE_Datetime objects you can use to pull the information you need.

How do you pull the data? You have ‘getters’ and ‘setters’ on most objects, you can also access some properties directly.

Use kint debugger, wrap the current object in d(); to see what methods you have available to pull details and use them in the template.

The documentation I linked to above goes through this in further detail.

The support post ‘Field Names’ 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