function getNotifications($start_date = '', $end_date = '', $orders = array(), $notification_types = array(), $continue_token = '') { require_once 'xml-processing/gc_xmlparser.php'; require_once 'xml-processing/gc_xmlbuilder.php'; $this->start_date = $start_date; $this->end_date = $end_date; $this->orders = $orders; $this->notification_types = $notification_types; $this->continue_token = $continue_token; $notifications = array(); $invalid_order_numbers = array(); do { list($status, $response) = $this->_doReportsRequest(); if ($status != '200') { $this->error = array($status, $response); return null; } //echo '<xmp>'; print_r($response); echo '</xmp>'; $xml_parser = new gc_XmlParser($response); $data = $xml_parser->GetData(); $root = $xml_parser->GetRoot(); $this->continue_token = $data[$root]['continue-token']['VALUE']; $notifications = $data[$root]['notifications']; $invalid_order_numbers = $data[$root]['invalid-order-numbers']; } while ($data[$root]['has-more-notifications']['VALUE'] == 'true'); return array($notifications, $invalid_order_numbers); }
/** * @param $xmlData * * @return array */ public static function getArrayFromXML($xmlData) { require_once 'Google/library/xml-processing/gc_xmlparser.php'; $xmlParser = new gc_XmlParser($xmlData); $root = $xmlParser->GetRoot(); $data = $xmlParser->GetData(); return array($root, $data); }