parentiterator.inc 615 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /** @file parentiterator.inc
  3. * @ingroup SPL
  4. * @brief class FilterIterator
  5. * @author Marcus Boerger
  6. * @date 2003 - 2009
  7. *
  8. * SPL - Standard PHP Library
  9. */
  10. /**
  11. * @brief Iterator to filter parents
  12. * @author Marcus Boerger
  13. * @version 1.2
  14. * @since PHP 5.1
  15. *
  16. * This extended FilterIterator allows a recursive iteration using
  17. * RecursiveIteratorIterator that only shows those elements which have
  18. * children.
  19. */
  20. class ParentIterator extends RecursiveFilterIterator
  21. {
  22. /** @return whetehr the current element has children
  23. */
  24. function accept()
  25. {
  26. return $this->it->hasChildren();
  27. }
  28. }
  29. ?>