/[cvs]/nfo/php/libs/org.netfrag.glib/DesignPattern/Container.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.glib/DesignPattern/Container.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Sat Mar 1 16:51:50 2003 UTC revision 1.2 by joko, Sat Mar 1 21:12:13 2003 UTC
# Line 13  Line 13 
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   *   *
# Line 66  class DesignPattern_Container { Line 69  class DesignPattern_Container {
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  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed