Source for file eventlist.php

Documentation is available at eventlist.php

  1. <?php
  2.  
  3. class net_nemein_registrations_eventlist {
  4. // Configuration
  5. var $_topic;
  6. var $_config;
  7. var $_auth;
  8. var $_root_event;
  9. function net_nemein_registrations_eventlist ($topic, $config, $auth, $rootevent) {
  10. $this->_topic = $topic;
  11. $this->_config = $config;
  12. $this->_auth = $auth;
  13. $this->_root_event = $rootevent;
  14. }
  15. function query ($only_open = false) {
  16. debug_push("registrations::eventlist query");
  17. debug_add("Will query " . (is_null($this->_config->get("event_type")) ? "all types"
  18. : "type " . $this->_config->get("event_type")));
  19. if (is_null($this->_config->get("event_type")))
  20. $result = mgd_list_events ($this->_root_event->id, "start");
  21. else
  22. $result = mgd_list_events ($this->_root_event->id, "start", $this->_config->get("event_type"));
  23. if (! $result) {
  24. debug_add("Did not found any events. mgd_errstr was " . mgd_errstr());
  25. debug_pop();
  26. return Array();
  27. }
  28. $res = Array();
  29. while ($result->fetch()) {
  30. $regevent = $this->get_regevent(mgd_get_event($result->id));
  31. if ($only_open == false || $regevent->is_open())
  32. $res[$result->id] = $regevent->event;
  33. }
  34. debug_pop();
  35. return $res;
  36. }
  37. function get_regevent ($event) {
  38. return new net_nemein_registrations_regevent($event, $this->_topic, $this->_config,
  39. $this->_auth, $this->_root_event);
  40. }
  41. }
  42.  
  43.  
  44. ?>

Documentation generated on Mon, 21 Nov 2005 18:15:06 +0100 by phpDocumentor 1.3.0RC3