2003-11-22 20:52:06 +00:00
|
|
|
<?php
|
|
|
|
|
2004-10-29 20:58:58 +00:00
|
|
|
/** @file parentiterator.inc
|
2004-10-31 19:05:37 +00:00
|
|
|
* @ingroup SPL
|
2004-10-29 20:58:58 +00:00
|
|
|
* @brief class FilterIterator
|
|
|
|
* @author Marcus Boerger
|
2007-03-04 12:18:02 +00:00
|
|
|
* @date 2003 - 2006
|
2004-10-29 20:58:58 +00:00
|
|
|
*
|
|
|
|
* SPL - Standard PHP Library
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Iterator to filter parents
|
|
|
|
* @author Marcus Boerger
|
2005-09-15 03:54:42 +00:00
|
|
|
* @version 1.2
|
|
|
|
* @since PHP 5.1
|
2004-10-29 20:58:58 +00:00
|
|
|
*
|
|
|
|
* This extended FilterIterator allows a recursive iteration using
|
|
|
|
* RecursiveIteratorIterator that only shows those elements which have
|
|
|
|
* children.
|
|
|
|
*/
|
2005-09-15 03:54:42 +00:00
|
|
|
class ParentIterator extends RecursiveFilterIterator
|
2003-11-22 20:52:06 +00:00
|
|
|
{
|
2004-10-29 20:58:58 +00:00
|
|
|
/** @return whetehr the current element has children
|
|
|
|
*/
|
2003-11-22 20:52:06 +00:00
|
|
|
function accept()
|
|
|
|
{
|
|
|
|
return $this->it->hasChildren();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|