# Example init

When you have valid connection object pass to the Calendar contructor.
$calendar = new \MGoogle\Calendar($connection);

# Get all calendars

$calendar = new \MGoogle\Calendar($connection);
$calendars = $calendar->getCalendars();

# Get calendar by name

$calendar = new \MGoogle\Calendar($connection);
$calendar->getCalendarID('CALENDAR_NAME');

# Save new event.

If not specific calendar is set will save to default calendar.
$calendar = new \MGoogle\Calendar($connection);
$calendar->saveEvent([
    'name' => 'Event name',
    'color' => 'orange',
    // Start, End time
    'time' => [ time(), time() + 3600 ]
]);

# Update event.

If you pass "id" ( Google calendar id ) will update the event in calendar
$calendar = new \MGoogle\Calendar($connection);
$calendar->saveEvent([
    // Google Event calendar returned from saving a new event
    'id' => 'g7k7*******************4v8',

    // Updated name
    'name' => 'Updated event name',

    // Updated color
    'color' => 'grey',

    // Start, End time
    'time' => [ time(), time() + 3600 ]
]);