private function parseItemNodes(\DOMNode $source, \DOMNodeList $resources, Sco $parentSco = null)
    {
        $item = $source->firstChild;
        $scos = [];

        while (!is_null($item)) {
            if ('item' === $item->nodeName) {
                $sco = new Sco();
                $scos[] = $sco;
                $sco->setScoParent($parentSco);
                $this->findAttrParams($sco, $item, $resources);
                $this->findNodeParams($sco, $item->firstChild);

                if ($sco->isBlock()) {
                    $sco->setScoChildren($this->parseItemNodes($item, $resources, $sco));
                }
            }
            $item = $item->nextSibling;
        }

        return $scos;
    }
private function parseItemNodes(\DOMNode $source, \DOMNodeList $resources, Sco $parentSco = null)
    {
        $item = $source->firstChild;
        $scos = [];

        while (!is_null($item)) {
            if ('item' === $item->nodeName) {
                $sco = new Sco();
                $scos[] = $sco;
                $sco->setScoParent($parentSco);
                $this->findAttrParams($sco, $item, $resources);
                $this->findNodeParams($sco, $item->firstChild);

                if ($sco->isBlock()) {
                    $sco->setScoChildren($this->parseItemNodes($item, $resources, $sco));
                }
            }
            $item = $item->nextSibling;
        }

        return $scos;
    }
private function parseItemNodes ( \ DOMNode $ source , \ DOMNodeList $ resources , Sco $ parentSco = null ) { $ item = $ source -> firstChild ; $ scos = [ ] ; while ( ! is_null ( $ item ) ) { if ( 'item' === $ item -> nodeName ) { $ sco = new Sco ( ) ; $ scos [ ] = $ sco ; $ sco -> setScoParent ( $ parentSco ) ; $ this -> findAttrParams ( $ sco , $ item , $ resources ) ; $ this -> findNodeParams ( $ sco , $ item -> firstChild ) ; if ( $ sco -> isBlock ( ) ) { $ sco -> setScoChildren ( $ this -> parseItemNodes ( $ item , $ resources , $ sco ) ) ; } } $ item = $ item -> nextSibling ; } return $ scos ; }
Creates defined structure of SCOs.

@param \DOMNode     $source
@param \DOMNodeList $resources
@param Sco          $parentSco

@return array of Sco

@throws InvalidScormArchiveException
Creates defined structure of SCOs .