private function doServicesRequest() { $source = $this->doRequest(); if ($source !== false) { parent::parseResponse($source); if (count($this->respErrorsList) == 0) { $carriers = $this->xpath->query('/operators/operator'); foreach ($carriers as $c => $carrier) { $index = $c + 1; $result = $this->parseCarrierNode($carrier); $this->carriers[$result["code"]] = $result; $this->carriers[$result["code"]]["services"] = $this->parseServicesNode($index); } } } }
/** * Function executes services request and prepares the $carriers array. * @access private * @return Void */ private function doServicesRequest() { $source = $this->doRequest(); /* Uncomment if ou want to display the XML content */ //echo '<textarea>'.$source.'</textarea>'; /* We make sure there is an XML answer and try to parse it */ if ($source !== false) { parent::parseResponse($source); if (count($this->respErrorsList) == 0) { /* The XML file is loaded, we now gather the datas */ $carriers = $this->xpath->query('/operators/operator'); foreach ($carriers as $c => $carrier) { $index = $c + 1; $result = $this->parseCarrierNode($carrier); $this->carriers[$result["code"]] = $result; $this->carriers[$result["code"]]["services"] = $this->parseServicesNode($index); } } } }