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