Inheritance diagram for SplObjectStorage:


Public Member Functions | |
| attach ($obj) | |
| contains ($obj) | |
| count () | |
| current () | |
| detach ($obj) | |
| key () | |
| next () | |
| rewind () | |
| valid () | |
Private Attributes | |
| $index = 0 | |
| $storage = array() | |
Definition at line 23 of file splobjectstorage.inc.
| SplObjectStorage::attach | ( | $ | obj | ) |
| $obj | new object to attach to storage if not yet contained |
Definition at line 91 of file splobjectstorage.inc.
References contains().
00092 { 00093 if (is_object($obj) && !$this->contains($obj)) 00094 { 00095 $this->storage[] = $obj; 00096 } 00097 }
Here is the call graph for this function:

| SplObjectStorage::contains | ( | $ | obj | ) |
| obj | object to look for |
Definition at line 74 of file splobjectstorage.inc.
Referenced by attach().
00075 { 00076 if (is_object($obj)) 00077 { 00078 foreach($this->storage as $object) 00079 { 00080 if ($object === $obj) 00081 { 00082 return true; 00083 } 00084 } 00085 } 00086 return false; 00087 }
| SplObjectStorage::count | ( | ) |
Implements Countable.
Definition at line 66 of file splobjectstorage.inc.
00067 { 00068 return count($this->storage); 00069 }
| SplObjectStorage::current | ( | ) |
Implements Iterator.
Definition at line 51 of file splobjectstorage.inc.
00052 { 00053 return current($this->storage); 00054 }
| SplObjectStorage::detach | ( | $ | obj | ) |
| $obj | object to remove from storage |
Definition at line 101 of file splobjectstorage.inc.
References rewind().
00102 { 00103 if (is_object($obj)) 00104 { 00105 foreach($this->storage as $idx => $object) 00106 { 00107 if ($object === $obj) 00108 { 00109 unset($this->storage[$idx]); 00110 $this->rewind(); 00111 return; 00112 } 00113 } 00114 } 00115 }
Here is the call graph for this function:

| SplObjectStorage::key | ( | ) |
Implements Iterator.
Definition at line 44 of file splobjectstorage.inc.
Referenced by valid().
| SplObjectStorage::next | ( | ) |
Forward to next element.
Implements Iterator.
Definition at line 58 of file splobjectstorage.inc.
00059 { 00060 next($this->storage); 00061 $this->index++; 00062 }
| SplObjectStorage::rewind | ( | ) |
Rewind to top iterator as set in constructor.
Implements Iterator.
Definition at line 30 of file splobjectstorage.inc.
Referenced by detach().
00031 { 00032 rewind($this->storage); 00033 }
| SplObjectStorage::valid | ( | ) |
Implements Iterator.
Definition at line 37 of file splobjectstorage.inc.
References key().
00038 { 00039 return key($this->storage) !== false; 00040 }
Here is the call graph for this function:

SplObjectStorage::$index = 0 [private] |
Definition at line 26 of file splobjectstorage.inc.
SplObjectStorage::$storage = array() [private] |
Definition at line 25 of file splobjectstorage.inc.
1.5.2