Loggable.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * Interface that provides an interface which must be implemented by all objects wishing to be
  4. * recorded in the system log (and by extension the river).
  5. *
  6. * This interface defines a set of methods that permit the system log functions to
  7. * hook in and retrieve the necessary information and to identify what events can
  8. * actually be logged.
  9. *
  10. * To have events involving your object to be logged simply implement this interface.
  11. *
  12. * @package Elgg.Core
  13. * @subpackage DataModel.Loggable
  14. */
  15. interface Loggable {
  16. /**
  17. * Return an identification for the object for storage in the system log.
  18. * This id must be an integer.
  19. *
  20. * @return int
  21. */
  22. public function getSystemLogID();
  23. /**
  24. * Return the class name of the object.
  25. * Added as a function because get_class causes errors for some reason.
  26. *
  27. * @return string
  28. */
  29. public function getClassName();
  30. /**
  31. * Return the type of the object - eg. object, group, user, relationship, metadata, annotation etc
  32. *
  33. * @return string
  34. */
  35. public function getType();
  36. /**
  37. * Return a subtype. For metadata & annotations this is the 'name' and for relationship this is the
  38. * relationship type.
  39. *
  40. * @return string
  41. */
  42. public function getSubtype();
  43. /**
  44. * For a given ID, return the object associated with it.
  45. * This is used by the river functionality primarily.
  46. * This is useful for checking access permissions etc on objects.
  47. *
  48. * @param int $id GUID of an entity
  49. *
  50. * @return \ElggEntity
  51. */
  52. public function getObjectFromID($id);
  53. /**
  54. * Return the GUID of the owner of this object.
  55. *
  56. * @return int
  57. * @deprecated 1.8 Use getOwnerGUID() instead
  58. */
  59. public function getObjectOwnerGUID();
  60. }