Object Relational Mapping (ORM) – Overview
The Events Calendar ORM API is a powerful toolkit that simplifies the manipulation of event data within WordPress. It provides developers with a structured interface, with an Eloquent-like Object-Relational Mapper (ORM) Repository for CRUD operations, enabling seamless interaction with event-related content.
Within The Events Calendar and Event Tickets, we provide a number of ORM Repositories for our custom post types with helper-functions:
tribe_attendees()
– Attendee poststribe_events()
– Event poststribe_organizers()
– Organizer poststribe_tickets()
– Ticket poststribe_venues()
– Venue posts
Within each of these repositories, commands can be chained to perform each CRUD operation for that specific TEC custom post type:
- CREATE:
->create()
- READ: various options for filtering – see ORM Basics – Filtering
- UPDATE:
->save()
- DELETE:
->delete()
To get started with examples and more details check out our ORM Basics page.
If you’re looking to explore the actual code where the base repository is defined, it at this filepath: wp-content/plugins/the-events-calendar/common/src/Tribe/Repository.php
Whether you’re a seasoned developer or new to working with event management in WordPress, this documentation aims to equip you with the necessary knowledge and tools to leverage the TEC ORM API effectively.