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

Annotation of /nfo/php/libs/org.netfrag.glib/Data/Container.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Fri Jun 6 04:28:14 2003 UTC (21 years, 2 months ago) by joko
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +5 -4 lines
minor update: comment

1 joko 1.1 <?php
2     /**
3     * This file contains the Data::Container class.
4     *
5     * @author Andreas Motl <andreas.motl@ilo.de>
6     * @package org.netfrag.glib
7 joko 1.2 * @name Data::Container
8 joko 1.1 *
9     */
10    
11     /**
12 joko 1.4 * Cvs-Log:
13 joko 1.3 *
14 joko 1.4 * $Id: Container.php,v 1.3 2003/03/11 01:22:24 joko Exp $
15 joko 1.1 *
16     * $Log: Container.php,v $
17 joko 1.4 * Revision 1.3 2003/03/11 01:22:24 joko
18     * + fixed metadata for phpDocumentor
19     *
20 joko 1.3 * Revision 1.2 2003/03/05 18:54:44 joko
21     * updated docu - phpDocumentor is very strict about its 'blocks'...
22     *
23 joko 1.2 * Revision 1.1 2003/03/03 21:27:28 joko
24     * + initial commit
25     *
26 joko 1.1 * Revision 1.2 2003/03/01 21:12:13 joko
27     * new core methods
28     *
29     * Revision 1.1 2003/03/01 16:51:50 joko
30     * + initial commit
31     *
32     * Revision 1.1 2003/03/01 15:31:18 joko
33     * + initial commit
34     *
35     */
36    
37    
38     /**
39 joko 1.2 * --- Data::Container
40 joko 1.1 *
41     *
42     * @author Andreas Motl <andreas.motl@ilo.de>
43     * @copyright (c) 2003 - All Rights reserved.
44     * @license GNU LGPL (GNU Lesser General Public License)
45     *
46 joko 1.2 * @link http://www.netfrag.org/~joko/
47     * @link http://www.gnu.org/licenses/lgpl.txt
48 joko 1.1 *
49     * @package org.netfrag.glib
50 joko 1.2 * @subpackage Data
51     * @name Data::Container
52 joko 1.1 *
53     */
54     class Data_Container {
55    
56     var $_index;
57    
58     /**
59     * The constructor ...
60     * ... just does nothing.
61     *
62     * @param registry
63     */
64     function Data_Container() {
65     }
66    
67     function get_address($entity) {
68     return '_' . $entity;
69     }
70    
71     function &push() {
72     $args = &func_get_args();
73     $entity = array_shift($args);
74     $name = $this->get_address($entity);
75     // shrink array to single item?
76     if (sizeof($args) == 1) { $args = $args[0]; }
77     //$this->$entity[sizeof($this->$entity)] = &$args;
78     if (!is_array($this->$name)) {
79     php::array_cast_safe($this->$name);
80     }
81     array_push($this->$name, &$args);
82     }
83    
84     function &slot($entity, $slot) {
85     $name = $this->get_address($entity);
86     return $this->$name[$slot];
87     }
88    
89     function &last($entity) {
90     $name = $this->get_address($entity);
91     $item = &$this->$name;
92     return $item[sizeof($item) - 1];
93     }
94    
95     }
96    
97     ?>

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