Title: Inconsistency in ORM interface
Last modified: December 28, 2024

---

# Inconsistency in ORM interface

 *  Resolved [ssvtom](https://wordpress.org/support/users/ssvtom/)
 * (@ssvtom)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/inconsistency-in-orm-interface/)
 * When using the newer ORM interface, it seems there’s an inconsistency between
   events and venues. If I compare the two calls:
 * `$event_post = tribe_events()->where('ID', $event_id)->first();`
 * `$venue_post = tribe_venues()->where('ID', $location_id)->first();`
 * both return WP_Post results, however $event_post holds **all add’l TEC** data
   such as start_date, end_date, duration, multiday, etc, whereas $venue_post **
   only** returns core wp post data and is missing for instance address, zip code,
   city, etc. I am, of course able to access venue meta data with
 * `$venue_address = get_post_meta($location_id, '_VenueAddress', true);`
 * Is this how this is supposed to work? I would expect this data to also be included
   in the WP_Post result for venue…
 * I am using TEC 6.9.0, WP 6.7.1, PHP 8.2.6

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [ssvtom](https://wordpress.org/support/users/ssvtom/)
 * (@ssvtom)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/inconsistency-in-orm-interface/#post-18218797)
 * After investigating this a bit further, it turns out, that the ORM all() and 
   first() functions for venues do NOT return decorated post objects as there is
   no format_item function in the venues repository implementation; i.e. all() and
   first() return raw WP_Post objects (as returned from get_post()).
 * Potential solutions:
    - add a format_item function to the current venue repository implementation
    - use the undocumented filter tribe_repository_venues_format_item to provide
      a custom format_item function
 * For the first solution pls have a look at the Pull Request [https://github.com/the-events-calendar/the-events-calendar/pull/4870](https://github.com/the-events-calendar/the-events-calendar/pull/4870),
   which includes fixes for two issues we encountered.
 * Wrt. the second solution
 *     ```wp-block-code
       add_filter('tribe_repository_venues_format_item', function($formatted, $id) {    return tribe_get_venue_object($id);}, 10, 2);
       ```
   
 * did the trick for me.
 *  Plugin Support [Darian](https://wordpress.org/support/users/d0153/)
 * (@d0153)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/inconsistency-in-orm-interface/#post-18219579)
 * Hi [@ssvtom](https://wordpress.org/support/users/ssvtom/)
 * Thanks for reaching out.
 * I truly appreciate you taking the time to share your feedback and suggestions.
   I’ll ensure this is shared with our team for further review and consideration.
 * Feel free to let me know if you have other questions or concerns.
 *  Plugin Support [Darian](https://wordpress.org/support/users/d0153/)
 * (@d0153)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/inconsistency-in-orm-interface/#post-18221597)
 * Hi there,
 * It appears that there hasn’t been any recent activity on this thread, so we’ll
   go ahead and close this for now. However, if you have any additional questions
   or concerns, feel free to start a new thread.
 *  Plugin Support [Chika Ibeneme](https://wordpress.org/support/users/chikaibeneme/)
 * (@chikaibeneme)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/inconsistency-in-orm-interface/#post-18297679)
 * Hi [@ssvtom](https://wordpress.org/support/users/ssvtom/) ,
 * Thanks so much for your patience here.
 * With the latest release of our plugin we’ve resolved your issue, when you get
   a chance we ask that you please update your plugins in order to take advantage
   of this release.
 * You can learn more about our releases here:
    - [The Events Calendar 6.10.1](https://theeventscalendar.com/release-notes/the-events-calendar/the-events-calendar-6-10-1/)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Inconsistency in ORM interface’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Chika Ibeneme](https://wordpress.org/support/users/chikaibeneme/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/inconsistency-in-orm-interface/#post-18297679)
 * Status: resolved