4 messages in com.googlegroups.google-calendar-help-dataapiRe: Retrieve the ID of the last event...| From | Sent On | Attachments |
|---|---|---|
| DaNieL | 15 May 2008 01:59 | |
| Philipp Kewisch | 15 May 2008 02:45 | |
| DaNieL | 15 May 2008 03:18 | |
| Philipp Kewisch | 15 May 2008 12:51 |
| Subject: | Re: Retrieve the ID of the last event added![]() |
|---|---|
| From: | DaNieL (dani...@gmail.com) |
| Date: | 05/15/2008 03:18:12 AM |
| List: | com.googlegroups.google-calendar-help-dataapi |
Ehm... I cant retriefve the ID pointing the update or insert dates, is likely to work blinded..
Anyway, i've resolved at this way:
$newEvent = $service->insertEvent($event, $calUri); $eventId = $newEvent->id;
Thats what you meant with 'But you should be receiving the event as a response from the insertEvent() query, isn't that enough?', isnt it?
On 15 Mag, 11:45, Philipp Kewisch <kewi...@gmail.com> wrote:
Just get the events, sorted by last updated time, and look for the first event that has the same creation date as the updated date. There is no easy way to instruct the server to give you that event. But you should be receiving the event as a response from the insertEvent() query, isn't that enough?
Philipp
On May 15, 10:59 am, DaNieL <dani...@gmail.com> wrote:
Hi, how can i retrieve the ID of the last event that i add?
i use a function like this (it's just a test function, but the final structure will be similar):
function GCInsert($service, $IDcalendar, $inizio, $fine, $titolo,
$testo=false){
$event = $service->newEventEntry();
$calUri = 'http://www.google.com/calendar/feeds/'.$IDcalendar.'/
private/full';
if($titolo){ $event -> title = $service->newTitle($titolo); }
if($testo){ $event -> content = $service->newContent($testo); }
$when = $service -> newWhen();
$tzOffset = "+02";
list($startDate, $startTime)=explode($inizio, '|');
list($endDate, $endTime)=explode($fine, '|');
$when -> startTime =
"{$startDate}T{$startTime}:00.000{$tzOffset}:
00";
$when -> endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
$event -> when = array($when);
$newEvent = $service->insertEvent($event, $calUri);
}
then, how can i get the ID of the event added?
there is a method that works like the mysql_inser_id() function?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
goog...@googlegroups.com
To unsubscribe from this group, send email to
goog...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---




