Beispiel #1
0
 /**
  * Search for point of sales
  *
  * @param CultureFeed_Uitpas_Counter_Query_SearchPointsOfSaleOptions $query The query
  * @param string $method The request method
  */
 public function searchPointOfSales(CultureFeed_Uitpas_Counter_Query_SearchPointsOfSaleOptions $query, $method = CultureFeed_Uitpas::CONSUMER_REQUEST)
 {
     $data = $query->toPostData();
     if ($method == CultureFeed_Uitpas::CONSUMER_REQUEST) {
         $result = $this->oauth_client->consumerGetAsXml('uitpas/balie/pos', $data);
     } else {
         $result = $this->oauth_client->authenticatedGetAsXml('uitpas/balie/pos', $data);
     }
     try {
         $xml = new CultureFeed_SimpleXMLElement($result);
     } catch (Exception $e) {
         throw new CultureFeed_ParseException($result);
     }
     $pos = array();
     $objects = $xml->xpath('/response/balies/balie');
     $total = $xml->xpath_int('/response/total');
     foreach ($objects as $object) {
         $pos[] = CultureFeed_Uitpas_Counter::createFromXML($object);
     }
     return new CultureFeed_ResultSet($total, $pos);
 }