@@ 101-108 (lines=8) @@ | ||
98 | * |
|
99 | * @return mixed |
|
100 | */ |
|
101 | public function insertEvent($event) |
|
102 | { |
|
103 | if ($event instanceof Event) { |
|
104 | $event = $event->convertToGoogleEvent(); |
|
105 | } |
|
106 | ||
107 | return $this->calendarService->events->insert($this->calendarId, $event); |
|
108 | } |
|
109 | ||
110 | /** |
|
111 | * @param \Spatie\GoogleCalendar\Event|Google_Service_Calendar_Event $event |
|
@@ 115-122 (lines=8) @@ | ||
112 | * |
|
113 | * @return \Google_Service_Calendar_Event |
|
114 | */ |
|
115 | public function updateEvent($event) |
|
116 | { |
|
117 | if ($event instanceof Event) { |
|
118 | $event = $event->convertToGoogleEvent(); |
|
119 | } |
|
120 | ||
121 | return $this->calendarService->events->update($this->calendarId, $event->id, $event); |
|
122 | } |
|
123 | ||
124 | /** |
|
125 | * @param string|\Spatie\GoogleCalendar\Event $eventId |
|
@@ 127-134 (lines=8) @@ | ||
124 | /** |
|
125 | * @param string|\Spatie\GoogleCalendar\Event $eventId |
|
126 | */ |
|
127 | public function deleteEvent($eventId) |
|
128 | { |
|
129 | if ($eventId instanceof Event) { |
|
130 | $eventId = $eventId->id; |
|
131 | } |
|
132 | ||
133 | return $this->calendarService->events->delete($this->calendarId, $eventId); |
|
134 | } |
|
135 | ||
136 | public function getService() : Google_Service_Calendar |
|
137 | { |