Slet kalenderposter i google calendar vedhjælp af zend framework
Som titlen siger, har jeg lidt problemer med at få mit zend framework til at slette poster i google calendar.Dette er min kode so far:
<?php
$GCuser = "MinEmail";
$GCpass = "MitPass";
$clientLibraryPath = "library";
$oldPath = set_include_path(get_include_path() . PATH_SEPARATOR . $clientLibraryPath);
require_once("Zend/Loader.php");
Zend_Loader::loadClass("Zend_Gdata");
Zend_Loader::loadClass("Zend_Gdata_ClientLogin");
Zend_Loader::loadClass("Zend_Gdata_Calendar");
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($GCuser,$GCpass,$service);
for($x = 0; $x < 1; $x++)
{
$eventIDs = "eventIDs.txt";
$fo = fopen($eventIDs, 'r');
$eventURL = fgets($fo);
$eventEditUrl = $event->getLink($eventURL)->href;
$gdataCal->delete($eventEditUrl);
}
fclose($fo);
?>
Det der ligger i tekst filen, er en URL jeg har fået ud af denne funktion (Som er en del af et andet script):
function createEvent ($client, $title, $desc, $where, $startDate, $startTime,$endDate, $endTime, $tzOffset)
{
$gdataCal = new Zend_Gdata_Calendar($client);
$newEvent = $gdataCal->newEventEntry();
$newEvent->title = $gdataCal->newTitle($title);
$newEvent->where = array($gdataCal->newWhere($where));
$newEvent->content = $gdataCal->newContent("$desc");
$when = $gdataCal->newWhen();
$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
$newEvent->when = array($when);
$createdEvent = $gdataCal->insertEvent($newEvent);
return $createdEvent->id->text;
}
Den fejl jeg får er:
Fatal error: Call to a member function getLink() on a non-object in /var/www/hense.dk/gc/delete.php on line 45
Nogen som har en idé til hvad jeg kan gøre ?