The note above posted by tony at tonyandcarol dot com could be improved adding the methods:
function getCollection()
{
return $this->data;
}
function exists($_id)
{
if($_thisObject = $this->data->offSetExists($_id))
return true;
else
return false;
}
The first one might be useful to call an iterator:
$iterator = $myCollection->getCollection()->getIterator();
while($iterator->valid())
{
echo $iterator->key() . ' => ' . $iterator->current()->getObject() . "\n";
$iterator->next();
}
The second one might be useful to control the function addObject($_id, $_object).
if($myCollection->exists($key))
$myCollection->addObject($key,$myCollection->getObject($key)+1);
else
$myCollection->addObject($key, 1);
----
Server IP: 69.147.83.197
Probable Submitter: 188.81.84.169
----
Manual Page -- http://www.php.net/manual/en/class.arrayobject.php
Edit -- https://master.php.net/note/edit/102348
Del: integrated -- https://master.php.net/note/delete/102348/integrated
Del: useless -- https://master.php.net/note/delete/102348/useless
Del: bad code -- https://master.php.net/note/delete/102348/bad+code
Del: spam -- https://master.php.net/note/delete/102348/spam
Del: non-english -- https://master.php.net/note/delete/102348/non-english
Del: in docs -- https://master.php.net/note/delete/102348/in+docs
Del: other reasons-- https://master.php.net/note/delete/102348
Reject -- https://master.php.net/note/reject/102348
Search -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.