Development

/plugins/sfFlickrGalleryPlugin/lib/Phlickr/AuthedGroup.php

You must first sign up to be able to contribute.

root/plugins/sfFlickrGalleryPlugin/lib/Phlickr/AuthedGroup.php

Revision 3879, 1.9 kB (checked in by Xavier.Luthi, 6 years ago)

Initial import of sfFlickrGalleryPlugin (version 0.1.0)

Line 
1 <?php
2
3 /**
4  * @version $Id: AuthedGroup.php 506 2006-01-28 04:17:13Z drewish $
5  * @author  Andrew Morton <drewish@katherinehouse.com>
6  * @license http://opensource.org/licenses/lgpl-license.php
7  *          GNU Lesser General Public License, Version 2.1
8  * @package Phlickr
9  */
10
11 /**
12  * This class extends Group_Photo.
13  */
14 require_once 'Phlickr/Group.php';
15
16 /**
17  * Phlickr_AuthedGroup allows a user to photos to groups they are a member of.
18  *
19  * @package Phlickr
20  * @author  Andrew Morton <drewish@katherinehouse.com>
21  * @see     Phlickr_Group
22  * @since   0.2.1
23  * @todo    Add sample code.
24  */
25 class Phlickr_AuthedGroup extends Phlickr_Group {
26     /**
27      * Constructor.
28      *
29      * You can construct a group from an Id or XML.
30      *
31      * @param   object Phlickr_API $api
32      * @param   mixed $source string Id, object SimpleXMLElement
33      * @throws  Phlickr_Exception, Phlickr_ConnectionException,
34      *          Phlickr_XmlParseException
35      */
36     function __construct(Phlickr_Api $api, $source) {
37         parent::__construct($api, $source);
38     }
39
40     /**
41      * Add a photo to the group.
42      *
43      * @param   string $photo Flickr photo id.
44      * @return  void
45      * @see     remove()
46      * @since   0.2.1
47      */
48     function add($photo) {
49         $this->getApi()->executeMethod(
50             'flickr.groups.pools.add',
51             array(
52                 'photo_id' => $photo,
53                 'group_id' => $this->getId()
54             )
55         );
56     }
57
58     /**
59      * Remove a photo from the group.
60      *
61      * @param   string $photo Flickr photo id.
62      * @return  void
63      * @see     remove()
64      * @since   0.2.1
65      */
66     function remove($photo) {
67         $this->getApi()->executeMethod(
68             'flickr.groups.pools.remove',
69             array(
70                 'photo_id' => $photo,
71                 'group_id' => $this->getId()
72             )
73         );
74     }
75 }
76
Note: See TracBrowser for help on using the browser.