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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Wed Mar 5 18:54:44 2003 UTC (21 years, 4 months ago) by joko
Branch: MAIN
Changes since 1.1: +10 -22 lines
updated docu - phpDocumentor is very strict about its 'blocks'...

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

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