public static function xmlDeserialize(SabreReader $reader)
    {
        $IodefElement = new static();
        $IodefElement->setAttributes($reader->parseAttributes());

        $innerData = $reader->parseInnerTree();

        // parseInnerTree will return an array or string.
        if (is_array($innerData)) {
            foreach ($innerData as $child) {
                // This should always and only by of type 'object'.
                if (gettype($child['value']) == 'object') {
                    $className = $child['value']->getShortName();
                    // We can expect multiple entries here, so add it to an array.
                    //if (substr($IodefElement->elements[$className], -6) == '_MULTI') {
                    if (in_array($IodefElement->elements[$className], [self::REQUIRED_MULTI, self::OPTIONAL_MULTI])) {
                        $IodefElement->{$className}[] = $child['value'];
                    } else {
                        $IodefElement->{$className} = $child['value'];
                    }
                }
            }
        } else {
            if (!empty($innerData)) {
                $IodefElement->value = $innerData;
            }
        }

        return $IodefElement;
    }
public static function xmlDeserialize(SabreReader $reader)
    {
        $IodefElement = new static();
        $IodefElement->setAttributes($reader->parseAttributes());

        $innerData = $reader->parseInnerTree();

        // parseInnerTree will return an array or string.
        if (is_array($innerData)) {
            foreach ($innerData as $child) {
                // This should always and only by of type 'object'.
                if (gettype($child['value']) == 'object') {
                    $className = $child['value']->getShortName();
                    // We can expect multiple entries here, so add it to an array.
                    //if (substr($IodefElement->elements[$className], -6) == '_MULTI') {
                    if (in_array($IodefElement->elements[$className], [self::REQUIRED_MULTI, self::OPTIONAL_MULTI])) {
                        $IodefElement->{$className}[] = $child['value'];
                    } else {
                        $IodefElement->{$className} = $child['value'];
                    }
                }
            }
        } else {
            if (!empty($innerData)) {
                $IodefElement->value = $innerData;
            }
        }

        return $IodefElement;
    }
public static function xmlDeserialize ( SabreReader $ reader ) { $ IodefElement = new static ( ) ; $ IodefElement -> setAttributes ( $ reader -> parseAttributes ( ) ) ; $ innerData = $ reader -> parseInnerTree ( ) ; // parseInnerTree will return an array or string. if ( is_array ( $ innerData ) ) { foreach ( $ innerData as $ child ) { // This should always and only by of type 'object'. if ( gettype ( $ child [ 'value' ] ) == 'object' ) { $ className = $ child [ 'value' ] -> getShortName ( ) ; // We can expect multiple entries here, so add it to an array. //if (substr($IodefElement->elements[$className], -6) == '_MULTI') { if ( in_array ( $ IodefElement -> elements [ $ className ] , [ self :: REQUIRED_MULTI , self :: OPTIONAL_MULTI ] ) ) { $ IodefElement -> { $ className } [ ] = $ child [ 'value' ] ; } else { $ IodefElement -> { $ className } = $ child [ 'value' ] ; } } } } else { if ( ! empty ( $ innerData ) ) { $ IodefElement -> value = $ innerData ; } } return $ IodefElement ; }
Convert XML Elements to IodefElement Objects
@param  SabreReader $reader
@return IodefElement
Convert XML Elements to IodefElement Objects