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

Source for file GalleryPhoto.php

Documentation is available at GalleryPhoto.php

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * Gallery photo endpoint class
  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_GalleryPhoto
  27.  *
  28.  * @category    Services
  29.  * @package     Services_Digg
  30.  * @author      Joe Stump <joe@joestump.net>
  31.  */
  32. {
  33.     /**
  34.      * __call
  35.      *
  36.      * @access      public
  37.      * @param       string      $function       Endpoint to call
  38.      * @param       array       $args 
  39.      * @throws      Services_Digg_Exception
  40.      */
  41.     public function __call($functionarray $args)
  42.     {
  43.        if (!isset($args[0]|| !is_numeric($args[0])) {
  44.             throw new Services_Digg_Exception('First argument must be numeric');
  45.         }
  46.  
  47.         $photo $args[0];
  48.  
  49.         $params = array();
  50.         if (isset($args[1]&& is_array($args[1]&& count($args[1])) {
  51.             $params $args[1];
  52.         }
  53.  
  54.         $endPoint '/galleryphoto/' $photo'/' $function;
  55.         return $this->sendRequest($endPoint$params);
  56.     }
  57.  
  58.     /**
  59.      * Get a specific comment on a photo
  60.      *
  61.      * @access      public
  62.      * @param       int         $commentid  ID of comment to fetch
  63.      * @param       array       $params     Digg API arguments
  64.      * @throws      Services_Digg_Exception
  65.      */
  66.     public function getCommentById($commentidarray $params = array())
  67.     {
  68.         $endPoint '/galleryphoto/' $this->id . '/comment/' $commentid;
  69.         $result $this->sendRequest($endPoint$params);
  70.         return $result->comments[0];
  71.     }
  72. }
  73.  
  74. ?>

Documentation generated on Fri, 10 Jul 2009 01:30:04 +0000 by phpDocumentor 1.4.2. PEAR Logo Copyright © PHP Group 2004.