Source for file class_container.php

Documentation is available at class_container.php

  1. <?php
  2. class container extends base {
  3. var $objects;
  4. var $retrievedObjects;
  5.  
  6. function container() {
  7. $this->objects = array();
  8. $this->retrievedObjects = array();
  9. }
  10. function register_object( &$object, $key = NULL ) {
  11. $this->objects[ $key ? $key : $object->get_attribute('id') ] = true;
  12. $this->retrievedObjects[ $key ? $key : $object->get_attribute('id') ] =& $object;
  13. }
  14. function unregister( $id ) {
  15. unset( $this->objects[$id] );
  16. unset( $this->retrievedObjects[$id] );
  17. }
  18. function output() {
  19. //this is essentially a debugging function
  20. echo "objects: ";
  21. print_array( $this->objects );
  22. echo "retrieved objects: ";
  23. foreach( $this->retrievedObjects as $object ) { print_r($object); }
  24. }
  25. }
  26. ?>

Documentation generated on Tue, 24 May 2005 03:57:28 -0400 by phpDocumentor 1.3.0RC3