Skip to content

Commit

Permalink
Merge pull request #6 from degordian/room-resources
Browse files Browse the repository at this point in the history
rooms as resources
  • Loading branch information
Tony Mrakovcic authored Nov 28, 2017
2 parents 8c1a1e9 + 0d2e2cf commit 64f4f3b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Adapters/RoomResourceGoogleCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
class RoomResourceGoogleCalendar implements RoomResourceAdapterInterface
{
const DEFAULT_TIME_ZONE = 'Europe/Zagreb';
const ACCEPTED = 'accepted';

private $config = [];

Expand Down Expand Up @@ -362,11 +363,18 @@ public function reserveRoom($room, $length = self::DEFAULT_MEET_LENGTH, $summary
'timeZone' => $this->getTimeZone(),
],
'attendees' => [
['email' => $this->getUserPrimaryCalendarId()],
[
'email' => $room->getId(),
'resource' => true,
],
[
'email' => $this->getUserPrimaryCalendarId(),
'responseStatus' => self::ACCEPTED
],
]
]);

$event = $this->getService()->events->insert($room->getId(), $event);
$event = $this->getService()->events->insert($this->getUserPrimaryCalendarId(), $event);
return $event;
}
}

0 comments on commit 64f4f3b

Please sign in to comment.