Event¶
To start using the Calendar Event API, add the following to the top of your file:
use EncoreDigitalGroup\PlanningCenter\Objects\Calendar\Event;
Event Class¶
Now we can create a new instance of the Event class;
$event = new Event($client);
All Events¶
To get all calendar events that exist in Planning Center, use the following method:
$event->all();
Future Events¶
To modify the Planning Center API Query, you can pass an argument to the all()
method.
$query = [
'filter' => 'future'
];
$event->all($query);
Specifically for Future Calendar Events, we have created a method that applies this query modification for you automatically.
$event->future();
Get an Event¶
To get a single Planning Center Calendar Event, pass the id
of the event to the get()
method
$event->eventId = YOUR_EVENT_ID;
$event->get();
Get Event Instances¶
$event->eventId = YOUR_EVENT_ID;
$event->instances();
Get a Single Event Instance¶
$event->eventId = YOUR_EVENT_ID;
$event->eventInstanceId = YOUR_EVENT_INSTANCE_ID;
$event->instance();
Get a Single Event Connection¶
$event->eventId = YOUR_EVENT_ID;
$event->connectionId = YOUR_CONNECTION_ID;
$event->connection();