Skip to content

Commit

Permalink
Fix structure getLevels function
Browse files Browse the repository at this point in the history
  • Loading branch information
jetwitaussi committed Sep 7, 2024
1 parent 54063b3 commit d67e718
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions PHT/Xml/World/LeagueStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ public function getLevel($number)
public function getLevels()
{
$xpath = new \DOMXPath($this->getXml());
$nodeList = $xpath->query('//Staff');
$nodeList = $xpath->query('//LeagueLevel');
$levels = new \DOMDocument('1.0', 'UTF-8');
for ($i = 0; $i < $nodeList->length; $i++) {
$levels->appendChild($levels->importNode($nodeList->item($i)->parentNode, true));
}
$nodes = $levels->getElementsByTagName('LeagueLevelItem');
/** @var \PHT\Xml\World\League\Level[] $data */
$data = new Utils\XmlIterator($nodeList, '\PHT\Xml\World\League\Level');
$data = new Utils\XmlIterator($nodes, '\PHT\Xml\World\League\Level');
return $data;
}
}

0 comments on commit d67e718

Please sign in to comment.