/**
  * @return GetSellerEventsResponseType
  * @param GetSellerEventsRequestType $request 
  */
 function GetSellerEvents($request)
 {
     $request->setVersion(EBAY_WSDL_VERSION);
     return $this->call('GetSellerEvents', $request);
 }
/**
* get_New_Events
* $mySession: Ebay_Acct Session
* $to: actual timestamp
* return $tmp: array, including all actual information
*****/
function get_new_Events($session, $to)
{
    $event_update_time = olc_db_query(SELECT . "event_update_time from " . TABLE_EBAY_CONFIG);
    $update_time = olc_db_fetch_array($event_update_time);
    $myupdate_time = $update_time['event_update_time'];
    if ($myupdate_time) {
        $from = $myupdate_time;
    } else {
        $event_first_time = olc_db_query(SELECT . "starttime" . SQL_FROM . TABLE_AUCTION_LIST . " ORDER BY starttime ASC");
        $first_time = olc_db_fetch_array($event_first_time);
        $from = $first_time['starttime'];
    }
    $cs = new EbatNs_ServiceProxy($session);
    $req = new GetSellerEventsRequestType();
    $req->setModTimeFrom($from);
    $req->setModTimeTo($to);
    $req->setNewItemFilter(false);
    $res = $cs->GetSellerEvents($req);
    if ($res->getAck() == 'Success') {
        $itemarray = $res->getItemArray();
        for ($i = 0; $i < count($itemarray); $i++) {
            $myitemid = $itemarray[$i]->getItemID();
            $item_sellingstatus = $itemarray[$i]->getSellingStatus();
            $item_listingdetails = $itemarray[$i]->getListingDetails();
            $tmp[$myitemid] = array('endtime' => $item_listingdetails->getEndTime(), 'bidcount' => $item_sellingstatus->getBidCount(), 'price' => $item_sellingstatus->CurrentPrice->value);
        }
        olc_db_query(SQL_UPDATE . TABLE_EBAY_CONFIG . " SET `event_update_time` = '" . $to . APOS . SQL_WHERE . "`id` =1");
    }
    return $tmp;
}