1<?php 2/** 3 * Implements a recursive iterator for options arrays 4 * 5 * PHP version 5 6 * 7 * LICENSE 8 * 9 * This source file is subject to BSD 3-Clause License that is bundled 10 * with this package in the file LICENSE and available at the URL 11 * https://raw.githubusercontent.com/pear/HTML_QuickForm2/trunk/docs/LICENSE 12 * 13 * @category HTML 14 * @package HTML_QuickForm2 15 * @author Alexey Borzov <avb@php.net> 16 * @author Bertrand Mansion <golgote@mamasam.com> 17 * @copyright 2006-2021 Alexey Borzov <avb@php.net>, Bertrand Mansion <golgote@mamasam.com> 18 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License 19 * @link https://pear.php.net/package/HTML_QuickForm2 20 */ 21 22/** 23 * Implements a recursive iterator for options arrays 24 * 25 * @category HTML 26 * @package HTML_QuickForm2 27 * @author Alexey Borzov <avb@php.net> 28 * @author Bertrand Mansion <golgote@mamasam.com> 29 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License 30 * @version Release: 2.2.2 31 * @link https://pear.php.net/package/HTML_QuickForm2 32 */ 33class HTML_QuickForm2_Element_Select_OptionIterator extends RecursiveArrayIterator 34 implements RecursiveIterator 35{ 36 public function hasChildren() 37 { 38 return $this->current() instanceof HTML_QuickForm2_Element_Select_OptionContainer; 39 } 40 41 public function getChildren() 42 { 43 return new HTML_QuickForm2_Element_Select_OptionIterator( 44 $this->current()->getOptions() 45 ); 46 } 47} 48?>