Ejemplo n.º 1
0
 public static function createFromXML(CultureFeed_SimpleXMLElement $object)
 {
     $device = new CultureFeed_Uitpas_Counter_Device();
     $device->name = $object->xpath_str('name');
     $device->consumerKey = $object->xpath_str('consumerKey');
     $device->status = $object->xpath_str('status');
     $device->cdbid = $object->xpath_str('cdbid');
     foreach ($object->xpath('balies/balie') as $balie) {
         $device->counters[] = CultureFeed_Uitpas_Counter::createFromXml($balie);
     }
     return $device;
 }
Ejemplo n.º 2
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);
 }