Skip to content

Commit

Permalink
Fix getting senior and youth season match round
Browse files Browse the repository at this point in the history
  • Loading branch information
jetwitaussi committed Sep 1, 2018
1 parent 90d5272 commit 021d957
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PHT/Xml/World/League/Season/Senior.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public function getRound($id)
{
$id = round($id);
if ($id >= Config\Config::$forIndex && $id < 14 + Config\Config::$forIndex) {
if (!Config\Config::$forIndex) {
$id++;
}
$xpath = new \DOMXPath($this->getXml());
$nodeList = $xpath->query("//MatchRound[.='" . $id . "']");
$matches = new \DOMDocument('1.0', 'UTF-8');
Expand Down
3 changes: 3 additions & 0 deletions PHT/Xml/World/League/Season/Youth.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public function getRound($id)
{
$id = round($id);
if ($id >= Config\Config::$forIndex && $id < (($this->getTeamsNumber() - 1) * 2) + Config\Config::$forIndex) {
if (!Config\Config::$forIndex) {
$id++;
}
$xpath = new \DOMXPath($this->getXml());
$nodeList = $xpath->query("//MatchRound[.='" . $id . "']");
$matches = new \DOMDocument('1.0', 'UTF-8');
Expand Down

0 comments on commit 021d957

Please sign in to comment.