Services_Digg
[ class tree: Services_Digg ] [ index: Services_Digg ] [ all elements ]

Source for file GalleryPhotos.php

Documentation is available at GalleryPhotos.php

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * Gallery photos endpoint driver
  7.  *
  8.  * PHP version 5.1.0+
  9.  *
  10.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  11.  * that is available through the world-wide-web at the following URI:
  12.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  13.  * the PHP License and are unable to obtain it through the web, please
  14.  * send a note to license@php.net so we can mail you a copy immediately.
  15.  *
  16.  * @category    Services
  17.  * @package     Services_Digg
  18.  * @author      Joe Stump <joe@joestump.net>
  19.  * @copyright   1997-2007 The PHP Group
  20.  * @license     http://www.php.net/license/3_0.txt  PHP License 3.0
  21.  * @version     CVS: $Id:$
  22.  * @link        http://pear.php.net/package/Services_Digg
  23.  */
  24.  
  25. /**
  26.  * Services_Digg_GalleryPhotos
  27.  *  
  28.  * @category    Services
  29.  * @package     Services_Digg
  30.  * @author      Joe Stump <joe@joestump.net>
  31.  */
  32. {
  33.     /**
  34.      * Get all users' gallery photos
  35.      *
  36.      * @access      public
  37.      * @param       array       $params     Digg API arguments
  38.      * @throws      Services_Digg_Exception
  39.      */
  40.     public function getAll(array $params = array())
  41.     {
  42.         return $this->sendRequest('/galleryphotos'$params);
  43.     }
  44.  
  45.     /**
  46.      * Get a single gallery photo by ID
  47.      *
  48.      * @access      public
  49.      * @param       int         $id     ID of gallery photo
  50.      * @throws      Services_Digg_Exception
  51.      */
  52.     public function getGalleryPhotoById($id
  53.     {
  54.         $result $this->sendRequest('/galleryphoto/' $id);
  55.         if (isset($result->photos[0])) {
  56.             return $result->photos[0];
  57.         }
  58.  
  59.         throw new Services_Digg_Exception('Photo not found'404);
  60.     }
  61.  
  62.     /**
  63.      * Get a list of gallery phtoos by their ID's
  64.      *
  65.      * @access      public
  66.      * @param       array       $photos     An array of photo ID's
  67.      * @param       array       $params     Digg API arguments
  68.      * @throws      Services_Digg_Exception
  69.      */
  70.     public function getGalleryPhotosById(array $photosarray $params = array())
  71.     {
  72.         $endPoint '/galleryphotos/' implode(','$photos);
  73.         return $this->sendRequest($endPoint$params);
  74.     }
  75. }
  76.  
  77. ?>

Documentation generated on Tue, 04 Dec 2007 15:00:07 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.