| 13 | * $Id$ | * $Id$ | 
| 14 | * | * | 
| 15 | * $Log$ | * $Log$ | 
| 16 |  | * Revision 1.2  2003/03/01 21:12:13  joko | 
| 17 |  | * new core methods | 
| 18 |  | * | 
| 19 | * Revision 1.1  2003/03/01 16:51:50  joko | * Revision 1.1  2003/03/01 16:51:50  joko | 
| 20 | * + initial commit | * + initial commit | 
| 21 | * | * | 
| 69 | function DesignPattern_Container() { | function DesignPattern_Container() { | 
| 70 | } | } | 
| 71 |  |  | 
| 72 | function __add_entity() { | function __get_address($entity) { | 
| 73 |  | return '_' . $entity; | 
| 74 |  | } | 
| 75 |  |  | 
| 76 |  | function &__push() { | 
| 77 | $args = &func_get_args(); | $args = &func_get_args(); | 
| 78 | print Dumper($args); | $entity = array_shift($args); | 
| 79 |  | $name = $this->__get_address($entity); | 
| 80 |  | // shrink array to single item? | 
| 81 |  | if (sizeof($args) == 1) { $args = $args[0]; } | 
| 82 |  | //$this->$entity[sizeof($this->$entity)] = &$args; | 
| 83 |  | array_push($this->$name, &$args); | 
| 84 |  | } | 
| 85 |  |  | 
| 86 |  | function &__slot($entity, $slot) { | 
| 87 |  | $name = $this->__get_address($entity); | 
| 88 |  | return $this->$name[$slot]; | 
| 89 |  | } | 
| 90 |  |  | 
| 91 |  | function &__last($entity) { | 
| 92 |  | $name = $this->__get_address($entity); | 
| 93 |  | $item = &$this->$name; | 
| 94 |  | return $item[sizeof($item) - 1]; | 
| 95 | } | } | 
| 96 |  |  | 
| 97 | } | } |