Overview

Packages

  • None
  • Service
    • Facebook

Classes

  • Horde_Service_Facebook_Auth
  • Horde_Service_Facebook_Base
  • Horde_Service_Facebook_BatchRequest
  • Horde_Service_Facebook_ErrorCodes
  • Horde_Service_Facebook_Events
  • Horde_Service_Facebook_Exception
  • Horde_Service_Facebook_Fql
  • Horde_Service_Facebook_Friends
  • Horde_Service_Facebook_Groups
  • Horde_Service_Facebook_Links
  • Horde_Service_Facebook_Notes
  • Horde_Service_Facebook_Notifications
  • Horde_Service_Facebook_Photos
  • Horde_Service_Facebook_Request
  • Horde_Service_Facebook_Streams
  • Horde_Service_Facebook_Translation
  • Horde_Service_Facebook_UploadRequest
  • Horde_Service_Facebook_Users
  • Horde_Service_Facebook_Videos
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Groups methods
 4:  *
 5:  * Copyright 2009-2012 Horde LLC (http://www.horde.org/)
 6:  *
 7:  * @author Michael J. Rubinsky <mrubinsk@horde.org>
 8:  * @category Horde
 9:  * @package Service_Facebook
10:  */
11: class Horde_Service_Facebook_Groups extends Horde_Service_Facebook_Base
12: {
13:     /**
14:      * Returns groups according to the filters specified.
15:      *
16:      * @param integer $uid   (Optional) User associated with groups.  A null
17:      *                       parameter will default to the session user.
18:      * @param string  $gids  (Optional) Comma-separated group ids to query. A null
19:      *                       parameter will get all groups for the user.
20:      *
21:      * @return array  An array of group objects
22:      */
23:     public function &get($uid, $gids)
24:     {
25:         // Session key is *required*
26:         if (!$skey = $this->_facebook->auth->getSessionKey()) {
27:             throw new Horde_Service_Facebook_Exception(
28:                 'session_key is required',
29:                 Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
30:         }
31:         return $this->_facebook->callMethod(
32:             'facebook.groups.get',
33:             array('uid' => $uid, 'gids' => $gids));
34:     }
35: 
36:     /**
37:      * Returns the membership list of a group.
38:      *
39:      * @param integer $gid  Group id
40:      *
41:      * @return array  An array with four membership lists, with keys 'members',
42:      *                'admins', 'officers', and 'not_replied'
43:      */
44:     public function &getMembers($gid)
45:     {
46:         // Session key is *required*
47:         if (!$skey = $this->_facebook->auth->getSessionKey()) {
48:             throw new Horde_Service_Facebook_Exception(
49:                 'session_key is required',
50:                 Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);
51:         }
52:         return $this->_facebook->callMethod(
53:             'facebook.groups.getMembers',
54:              array('gid' => $gid));
55:     }
56: 
57: }
API documentation generated by ApiGen