OData的PHP开发包,示例代码:
/*coecttotheODataservice*/$svc=ewNorthwidEtities(NORTHWIND_SERVICE_URL);/*getthelistofCustomersitheUSA,foreachcustomergetthelistofOrders*/$query=$svc->Customers()->filter("Coutryeq'USA'")->Expad('Orders');$customerRespose=$query->Execute();/*getolyCustomerIDadCustomerName*/$query=$svc->Customers()->filter("Coutryeq'USA'")->Select('CustomerID,CustomerName');$customerRespose=$query->Execute();/*createaewcustomer*/$customer=Customers::CreateCustomers('chael9','CHAN9');$proxy->AddToCustomers($customer);/*committhechageotheserver*/$proxy->SaveChages();点击空白处退出提示
评论