@@ 75-86 (lines=12) @@ | ||
72 | return $this->calendarService->events->get($this->calendarId, $eventId, $optParams); |
|
73 | } |
|
74 | ||
75 | public function getEvents(iterable $eventIds, $optParams = []) |
|
76 | { |
|
77 | $this->enableBatch(true); |
|
78 | ||
79 | collect($eventIds) |
|
80 | ->each( |
|
81 | function ($eventId, $batchIdentifier) use ($optParams) { |
|
82 | $this->batchRequests->add($this->getEvent($eventId, $optParams), "get-".$batchIdentifier); |
|
83 | }); |
|
84 | ||
85 | return $this; |
|
86 | } |
|
87 | ||
88 | /** |
|
89 | * @param $event |
|
@@ 104-115 (lines=12) @@ | ||
101 | return $this->calendarService->events->insert($this->calendarId, $event, $optParams); |
|
102 | } |
|
103 | ||
104 | public function insertEvents(iterable $events, $optParams = []) |
|
105 | { |
|
106 | $this->enableBatch(true); |
|
107 | ||
108 | collect($events) |
|
109 | ->each( |
|
110 | function ($event, $batchIdentifier) use ($optParams) { |
|
111 | $this->batchRequests->add($this->insertEvent($event, $optParams), "insert-".$batchIdentifier); |
|
112 | }); |
|
113 | ||
114 | return $this; |
|
115 | } |
|
116 | ||
117 | /** |
|
118 | * @param $event |
|
@@ 132-143 (lines=12) @@ | ||
129 | return $this->calendarService->events->update($this->calendarId, $event->id, $event, $optParams); |
|
130 | } |
|
131 | ||
132 | public function updateEvents(iterable $events, $optParams = []) |
|
133 | { |
|
134 | $this->enableBatch(true); |
|
135 | ||
136 | collect($events) |
|
137 | ->each( |
|
138 | function ($event, $batchIdentifier) use ($optParams) { |
|
139 | $this->batchRequests->add($this->updateEvent($event, $optParams), "update-".$batchIdentifier); |
|
140 | }); |
|
141 | ||
142 | return $this; |
|
143 | } |
|
144 | ||
145 | /** |
|
146 | * @param $eventId |
|
@@ 166-177 (lines=12) @@ | ||
163 | * |
|
164 | * @return $this |
|
165 | */ |
|
166 | public function deleteEvents(iterable $eventIds, $optParams = []) |
|
167 | { |
|
168 | $this->enableBatch(true); |
|
169 | ||
170 | collect($eventIds) |
|
171 | ->each( |
|
172 | function ($eventId, $batchIdentifier) use ($optParams) { |
|
173 | $this->batchRequests->add($this->deleteEvent($eventId, $optParams), "delete-".$batchIdentifier); |
|
174 | }); |
|
175 | ||
176 | return $this; |
|
177 | } |
|
178 | ||
179 | public function getService(): Google_Service_Calendar |
|
180 | { |