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

Source for file Users.php

Documentation is available at Users.php

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * Users endpoint for Digg API
  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_Users
  27.  *  
  28.  * @category    Services
  29.  * @package     Services_Digg
  30.  * @author      Joe Stump <joe@joestump.net>
  31.  */
  32. {
  33.     /**
  34.      * Search all users
  35.      *
  36.      * @access      public
  37.      * @param       array       $params 
  38.      * @throws      Services_Digg_Exception
  39.      */
  40.     public function getAll(array $params = array())
  41.     {
  42.         return $this->sendRequest('/users'$params);
  43.     }
  44.  
  45.     /**
  46.      * Get a user by name
  47.      *
  48.      * @access      public
  49.      * @param       string      $username       Username to fetch
  50.      * @param       array       $params 
  51.      * @throws      Services_Digg_Exception
  52.      */
  53.     public function getUserByName($usernamearray $params = array())
  54.     {
  55.         $result $this->sendRequest('/user/' $username);
  56.         return $result->users[0];
  57.     }
  58.  
  59.     /**
  60.      * Get a list of users by names
  61.      *
  62.      * @access      public
  63.      * @param       array       $usernames  An array of usernames
  64.      * @param       array       $params     Digg API arguments
  65.      * @throws      Services_Digg_Exception
  66.      */
  67.     public function getUsersByName(array $usernamesarray $params = array())
  68.     {
  69.         $endPoint '/users/' implode(','$usernames);
  70.         return $this->sendRequest($endPoint$params);  
  71.     }
  72.  
  73.     /**
  74.      * Get a list of users' comments
  75.      *
  76.      * @access      public
  77.      * @param       array       $usernames  An array of usernames
  78.      * @param       array       $params     Digg API arguments
  79.      * @throws      Services_Digg_Exception
  80.      */
  81.     public function getUsersComments(array $usernamesarray $params = array())
  82.     {
  83.         $endPoint '/users/' implode(','$usernames'/comments';
  84.         return $this->sendRequest($endPoint$params);  
  85.     }
  86.  
  87.     /**
  88.      * Get a list of users' diggs
  89.      *
  90.      * @access      public
  91.      * @param       array       $usernames  An array of usernames
  92.      * @param       array       $params     Digg API arguments
  93.      * @throws      Services_Digg_Exception
  94.      */
  95.     public function getUsersDiggs(array $usernamesarray $params = array())
  96.     {
  97.         $endPoint '/users/' implode(','$usernames'/diggs';
  98.         return $this->sendRequest($endPoint$params);  
  99.     }
  100. }
  101.  
  102. ?>

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