/** * Deletes the specified tag * * @param Zend_Http_Client $client The authenticated client * @param string $user The user's account name * @param integer $albumId The album's id * @param integer $photoId The photo's id * @param string $tagContent The name of the tag to be deleted * @return void */ function deleteTag($client, $user, $albumId, $photoId, $tagContent) { $photos = new Zend_Gdata_Photos($client); $photoQuery = new Zend_Gdata_Photos_PhotoQuery(); $photoQuery->setUser($user); $photoQuery->setAlbumId($albumId); $photoQuery->setPhotoId($photoId); $query = $photoQuery->getQueryUrl() . "?kind=tag"; $photoFeed = $photos->getPhotoFeed($query); foreach ($photoFeed as $entry) { if ($entry instanceof Zend_Gdata_Photos_TagEntry) { if ($entry->getContent() == $tagContent) { $tagEntry = $entry; } } } $photos->deleteTagEntry($tagEntry, true); outputPhotoFeed($client, $user, $albumId, $photoId); }
/** * Check the consistency of a user feed request for private data */ public function testPrivatePhotoQuery() { $queryString = "http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1/photoid/1?access=private"; $query = new Zend_Gdata_Photos_PhotoQuery(); $query->setUser("sample.user"); $query->setAlbumId("1"); $query->setPhotoId("1"); $query->setAccess("private"); $generatedString = $query->getQueryUrl(); // Assert that the generated query matches the correct one $this->assertEquals($queryString, $generatedString); }