Beispiel #1
0
 /**
  * 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 */
     /* We make sure there is an XML answer and try to parse it */
     if ($source !== false) {
         parent::parseResponse($source);
         if (count($this->resp_errors_list) == 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);
             }
         }
     }
 }