/** * Deletes a Base item entry * * @param Zend_Http_Client $client The authenticated client object * @param string $itemUrl The URL of the item to be deleted * @return void */ function deleteItem($client, $itemUrl, $dryRun = false) { echo "<h2>Delete an item</h2>\n"; $service = new Zend_Gdata_Gbase($client); if ($entry = $service->getGbaseItemEntry($itemUrl)) { try { echo "\t<ol><li><b>" . $entry->title->text . "</b><br />\n"; echo "\t<span>" . $entry->id->text . "</span><br />\n"; echo "\t<p>" . $entry->content->text . "</p></li></ol>\n"; $entry->delete($dryRun); echo "\tSuccessfully deleted entry at " . $itemUrl . "<br /><br />\n"; } catch (Zend_Gdata_App_Exception $e) { echo "<div class='error'>ERROR:</div><br />\n"; var_dump($e); return null; } } else { echo "\tNo items match.<br />\n"; return null; } }
/** * Deletes a recipe by performing an HTTP DELETE on its feed URI. * @return void */ function deleteItem() { $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']); $gdata = new Zend_Gdata_Gbase($client); $itemUrl = $_POST['link']; $deleteEntry = $gdata->getGbaseItemEntry($itemUrl); $dryRun = false; $gdata->deleteGbaseItem($deleteEntry, $dryRun); // Alternatively, you can call the save() method directly on the entry // $gdata->delete($itemUrl); }