| @@ 85-92 (lines=8) @@ | ||
| 82 | * |
|
| 83 | * @return mixed |
|
| 84 | */ |
|
| 85 | public function insertEvent($event) |
|
| 86 | { |
|
| 87 | if ($event instanceof Event) { |
|
| 88 | $event = $event->googleEvent; |
|
| 89 | } |
|
| 90 | ||
| 91 | return $this->calendarService->events->insert($this->calendarId, $event); |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * @param \Spatie\GoogleCalendar\Event|Google_Service_Calendar_Event $event |
|
| @@ 99-106 (lines=8) @@ | ||
| 96 | * |
|
| 97 | * @return \Google_Service_Calendar_Event |
|
| 98 | */ |
|
| 99 | public function updateEvent($event) |
|
| 100 | { |
|
| 101 | if ($event instanceof Event) { |
|
| 102 | $event = $event->googleEvent; |
|
| 103 | } |
|
| 104 | ||
| 105 | return $this->calendarService->events->update($this->calendarId, $event->id, $event); |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * @param string|\Spatie\GoogleCalendar\Event $eventId |
|
| @@ 113-122 (lines=10) @@ | ||
| 110 | * |
|
| 111 | * @return mixed |
|
| 112 | */ |
|
| 113 | public function deleteEvent($eventId) |
|
| 114 | { |
|
| 115 | if ($eventId instanceof Event) { |
|
| 116 | $eventId = $eventId->id; |
|
| 117 | } |
|
| 118 | ||
| 119 | dd($eventId); |
|
| 120 | ||
| 121 | return $this->calendarService->events->delete($this->calendarId, $eventId); |
|
| 122 | } |
|
| 123 | ||
| 124 | public function getService() : Google_Service_Calendar |
|
| 125 | { |
|