objects.php 1008 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Elgg objects
  4. * Functions to manage multiple or single objects in an Elgg install
  5. *
  6. * @package Elgg
  7. * @subpackage Core
  8. */
  9. /**
  10. * Return the object specific details of a object by a row.
  11. *
  12. * @param int $guid The guid to retrieve
  13. *
  14. * @return bool
  15. * @access private
  16. */
  17. function get_object_entity_as_row($guid) {
  18. global $CONFIG;
  19. $guid = (int)$guid;
  20. return get_data_row("SELECT * from {$CONFIG->dbprefix}objects_entity where guid=$guid");
  21. }
  22. /**
  23. * Runs unit tests for \ElggObject
  24. *
  25. * @param string $hook unit_test
  26. * @param string $type system
  27. * @param mixed $value Array of tests
  28. * @param mixed $params Params
  29. *
  30. * @return array
  31. * @access private
  32. */
  33. function _elgg_objects_test($hook, $type, $value, $params) {
  34. global $CONFIG;
  35. $value[] = "{$CONFIG->path}engine/tests/ElggObjectTest.php";
  36. return $value;
  37. }
  38. return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
  39. $hooks->registerHandler('unit_test', 'system', '_elgg_objects_test');
  40. };