Oara\Network\Publisher\WebGains::getCampaignMap PHP Method

getCampaignMap() private method

private getCampaignMap ( $html ) : array
$html
return array
    private function getCampaignMap($html)
    {
        $campaingMap = array();
        $doc = new \DOMDocument();
        @$doc->loadHTML($html);
        $xpath = new \DOMXPath($doc);
        $results = $xpath->query('//select[@name="campaignswitchid"]');
        $merchantLines = $results->item(0)->childNodes;
        for ($i = 0; $i < $merchantLines->length; $i++) {
            $cid = $merchantLines->item($i)->attributes->getNamedItem("value")->nodeValue;
            $name = $merchantLines->item($i)->nodeValue;
            if (\count($this->_sitesAllowed) == 0 || \in_array($name, $this->_sitesAllowed)) {
                if (\is_numeric($cid)) {
                    $campaingMap[$cid] = $merchantLines->item($i)->nodeValue;
                }
            }
        }
        return $campaingMap;
    }