Friendable.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. * Removes a user as a friend
  19. *
  20. * @param int $friend_guid The GUID of the user to remove
  21. *
  22. * @return bool
  23. */
  24. public function removeFriend($friend_guid);
  25. /**
  26. * Determines whether or not the current user is a friend of this entity
  27. *
  28. * @return bool
  29. */
  30. public function isFriend();
  31. /**
  32. * Determines whether or not this entity is friends with a particular entity
  33. *
  34. * @param int $user_guid The GUID of the entity this entity may or may not be friends with
  35. *
  36. * @return bool
  37. */
  38. public function isFriendsWith($user_guid);
  39. /**
  40. * Determines whether or not a foreign entity has made this one a friend
  41. *
  42. * @param int $user_guid The GUID of the foreign entity
  43. *
  44. * @return bool
  45. */
  46. public function isFriendOf($user_guid);
  47. /**
  48. * Returns this entity's friends
  49. *
  50. * @param string $subtype The subtype of entity to return
  51. * @param int $limit The number of entities to return
  52. * @param int $offset Indexing offset
  53. *
  54. * @return array|false
  55. */
  56. public function getFriends($subtype = "", $limit = 10, $offset = 0);
  57. /**
  58. * Returns entities that have made this entity a friend
  59. *
  60. * @param string $subtype The subtype of entity to return
  61. * @param int $limit The number of entities to return
  62. * @param int $offset Indexing offset
  63. *
  64. * @return array|false
  65. */
  66. public function getFriendsOf($subtype = "", $limit = 10, $offset = 0);
  67. /**
  68. * Returns objects in this entity's container
  69. *
  70. * @param string $subtype The subtype of entity to return
  71. * @param int $limit The number of entities to return
  72. * @param int $offset Indexing offset
  73. *
  74. * @return array|false
  75. */
  76. public function getObjects($subtype = "", $limit = 10, $offset = 0);
  77. /**
  78. * Returns objects in the containers of this entity's friends
  79. *
  80. * @param string $subtype The subtype of entity to return
  81. * @param int $limit The number of entities to return
  82. * @param int $offset Indexing offset
  83. *
  84. * @return array|false
  85. */
  86. public function getFriendsObjects($subtype = "", $limit = 10, $offset = 0);
  87. /**
  88. * Returns the number of object entities in this entity's container
  89. *
  90. * @param string $subtype The subtype of entity to count
  91. *
  92. * @return int
  93. */
  94. public function countObjects($subtype = "");
  95. }