protected function getChildren()
    {
        $retArray = [];

        foreach ($this->elements as $element => $occurrence) {
            switch ($occurrence) {
                case 'REQUIRED':
                case self::REQUIRED:
                    if (property_exists($this, $element)) {
                        $retArray[] = [
                            'name'          => $this->ns.$element,
                            'attributes'    => array_filter($this->$element->attributes),
                            'value'         => $this->$element
                        ];
                    } else {
                        die(
                            $this->getShortName(get_called_class()) .": Required element '{$element}' missing."
                        );
                    }
                    break;
                case 'OPTIONAL':
                case self::OPTIONAL:
                    if (property_exists($this, $element)) {
                        $retArray[] = [
                            'name'          => $this->ns.$element,
                            'attributes'    => array_filter($this->$element->attributes),
                            'value'         => $this->$element
                        ];
                    }
                    break;
                case 'REQUIRED_MULTI':
                case self::REQUIRED_MULTI:
                    if (property_exists($this, $element)) {
                        foreach ($this->$element as $child) {
                            $retArray[] = [
                                'name'          => $this->ns.$element,
                                'attributes'    => array_filter($child->attributes),
                                'value'         => $child
                            ];
                        }
                    } else {
                        die(
                            $this->getShortName(get_called_class()) .": Required element '{$element}' missing."
                        );
                    }
                    break;
                case 'OPTIONAL_MULTI':
                case self::OPTIONAL_MULTI:
                    if (property_exists($this, $element)) {
                        foreach ($this->$element as $child) {
                            $retArray[] = [
                                'name'          => $this->ns.$element,
                                'attributes'    => array_filter($child->attributes),
                                'value'         => $child
                            ];
                        }
                    }
                    break;
                default:
                    die(
                        $this->getShortName(get_called_class()) .": Unknown occurence type for element {$element}."
                    );
            }
        }

        return $retArray;
    }
protected function getChildren()
    {
        $retArray = [];

        foreach ($this->elements as $element => $occurrence) {
            switch ($occurrence) {
                case 'REQUIRED':
                case self::REQUIRED:
                    if (property_exists($this, $element)) {
                        $retArray[] = [
                            'name'          => $this->ns.$element,
                            'attributes'    => array_filter($this->$element->attributes),
                            'value'         => $this->$element
                        ];
                    } else {
                        die(
                            $this->getShortName(get_called_class()) .": Required element '{$element}' missing."
                        );
                    }
                    break;
                case 'OPTIONAL':
                case self::OPTIONAL:
                    if (property_exists($this, $element)) {
                        $retArray[] = [
                            'name'          => $this->ns.$element,
                            'attributes'    => array_filter($this->$element->attributes),
                            'value'         => $this->$element
                        ];
                    }
                    break;
                case 'REQUIRED_MULTI':
                case self::REQUIRED_MULTI:
                    if (property_exists($this, $element)) {
                        foreach ($this->$element as $child) {
                            $retArray[] = [
                                'name'          => $this->ns.$element,
                                'attributes'    => array_filter($child->attributes),
                                'value'         => $child
                            ];
                        }
                    } else {
                        die(
                            $this->getShortName(get_called_class()) .": Required element '{$element}' missing."
                        );
                    }
                    break;
                case 'OPTIONAL_MULTI':
                case self::OPTIONAL_MULTI:
                    if (property_exists($this, $element)) {
                        foreach ($this->$element as $child) {
                            $retArray[] = [
                                'name'          => $this->ns.$element,
                                'attributes'    => array_filter($child->attributes),
                                'value'         => $child
                            ];
                        }
                    }
                    break;
                default:
                    die(
                        $this->getShortName(get_called_class()) .": Unknown occurence type for element {$element}."
                    );
            }
        }

        return $retArray;
    }
protected function getChildren ( ) { $ retArray = [ ] ; foreach ( $ this -> elements as $ element => $ occurrence ) { switch ( $ occurrence ) { case 'REQUIRED' : case self :: REQUIRED : if ( property_exists ( $ this , $ element ) ) { $ retArray [ ] = [ 'name' => $ this -> ns . $ element , 'attributes' => array_filter ( $ this -> $ element -> attributes ) , 'value' => $ this -> $ element ] ; } else { die ( $ this -> getShortName ( get_called_class ( ) ) . ": Required element '{$element}' missing." ) ; } break ; case 'OPTIONAL' : case self :: OPTIONAL : if ( property_exists ( $ this , $ element ) ) { $ retArray [ ] = [ 'name' => $ this -> ns . $ element , 'attributes' => array_filter ( $ this -> $ element -> attributes ) , 'value' => $ this -> $ element ] ; } break ; case 'REQUIRED_MULTI' : case self :: REQUIRED_MULTI : if ( property_exists ( $ this , $ element ) ) { foreach ( $ this -> $ element as $ child ) { $ retArray [ ] = [ 'name' => $ this -> ns . $ element , 'attributes' => array_filter ( $ child -> attributes ) , 'value' => $ child ] ; } } else { die ( $ this -> getShortName ( get_called_class ( ) ) . ": Required element '{$element}' missing." ) ; } break ; case 'OPTIONAL_MULTI' : case self :: OPTIONAL_MULTI : if ( property_exists ( $ this , $ element ) ) { foreach ( $ this -> $ element as $ child ) { $ retArray [ ] = [ 'name' => $ this -> ns . $ element , 'attributes' => array_filter ( $ child -> attributes ) , 'value' => $ child ] ; } } break ; default : die ( $ this -> getShortName ( get_called_class ( ) ) . ": Unknown occurence type for element {$element}." ) ; } } return $ retArray ; }
Get all chilren of the current IodefElement.
@return array List of child elements.
Get all chilren of the current IodefElement .