1: <?php
2: /**
3: * An interface for objects that behave as elements within a social network that have a profile.
4: *
5: * @package Elgg.Core
6: * @subpackage SocialModel.Friendable
7: */
8: interface Friendable {
9: /**
10: * Adds a user as a friend
11: *
12: * @param int $friend_guid The GUID of the user to add
13: *
14: * @return bool
15: */
16: public function addFriend($friend_guid);
17:
18: /**
19: * Removes a user as a friend
20: *
21: * @param int $friend_guid The GUID of the user to remove
22: *
23: * @return bool
24: */
25: public function removeFriend($friend_guid);
26:
27: /**
28: * Determines whether or not the current user is a friend of this entity
29: *
30: * @return bool
31: */
32: public function isFriend();
33:
34: /**
35: * Determines whether or not this entity is friends with a particular entity
36: *
37: * @param int $user_guid The GUID of the entity this entity may or may not be friends with
38: *
39: * @return bool
40: */
41: public function isFriendsWith($user_guid);
42:
43: /**
44: * Determines whether or not a foreign entity has made this one a friend
45: *
46: * @param int $user_guid The GUID of the foreign entity
47: *
48: * @return bool
49: */
50: public function isFriendOf($user_guid);
51:
52: /**
53: * Returns this entity's friends
54: *
55: * @param string $subtype The subtype of entity to return
56: * @param int $limit The number of entities to return
57: * @param int $offset Indexing offset
58: *
59: * @return array|false
60: */
61: public function getFriends($subtype = "", $limit = 10, $offset = 0);
62:
63: /**
64: * Returns entities that have made this entity a friend
65: *
66: * @param string $subtype The subtype of entity to return
67: * @param int $limit The number of entities to return
68: * @param int $offset Indexing offset
69: *
70: * @return array|false
71: */
72: public function getFriendsOf($subtype = "", $limit = 10, $offset = 0);
73:
74: /**
75: * Returns objects in this entity's container
76: *
77: * @param string $subtype The subtype of entity to return
78: * @param int $limit The number of entities to return
79: * @param int $offset Indexing offset
80: *
81: * @return array|false
82: */
83: public function getObjects($subtype = "", $limit = 10, $offset = 0);
84:
85: /**
86: * Returns objects in the containers of this entity's friends
87: *
88: * @param string $subtype The subtype of entity to return
89: * @param int $limit The number of entities to return
90: * @param int $offset Indexing offset
91: *
92: * @return array|false
93: */
94: public function getFriendsObjects($subtype = "", $limit = 10, $offset = 0);
95:
96: /**
97: * Returns the number of object entities in this entity's container
98: *
99: * @param string $subtype The subtype of entity to count
100: *
101: * @return int
102: */
103: public function countObjects($subtype = "");
104: }
105: