示例#1
0
文件: Photos.php 项目: jsnshrmn/Suma
/**
 * Deletes the specified comment
 *
 * @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  integer          $commentId The comment's id
 * @return void
 */
function deleteComment($client, $user, $albumId, $photoId, $commentId)
{
    $photos = new Zend_Gdata_Photos($client);
    $photoQuery = new Zend_Gdata_Photos_PhotoQuery();
    $photoQuery->setUser($user);
    $photoQuery->setAlbumId($albumId);
    $photoQuery->setPhotoId($photoId);
    $photoQuery->setType('entry');
    $path = $photoQuery->getQueryUrl() . '/commentid/' . $commentId;
    $entry = $photos->getCommentEntry($path);
    $photos->deleteCommentEntry($entry, true);
    outputPhotoFeed($client, $user, $albumId, $photoId);
}