Overview arrow_sm.gif Architecture arrow_sm.gif Contributors

Overview

OData_Logo.jpg


The OData SDK for PHP enables PHP developers to access data services that use the OData protocol. Detailed information on the OData protocol and the other SDKs available can be found at http://www.odata.org.

New features include:
  • Support for all new OData protocol features (Projections, Server-Side paging, Blobs, RowCounter and Customizable Feeds)
  • Support for Azure authentication
  • Better programming model with APIs for all Query Options
  • More command line options
  • Additional samples
Try the toolkit using some of the OData Services available on the internet:
Full list of services is available on the Producers page on the OData.org Web Site

The User Guide included in the OData SDK provides detailed documentation on the PHPDataSvcTool and methods exposed by the proxy class.
OData protocol documentation can be found on the OData Web site.
This version replaces the ADO.NET Data Services toolkit for PHP that was released in Sept 2009.

Architecture

The OData SDK for PHP is based on an utility (PHPDataSvcUtil) that is used to generate a proxy class from the metadata exposed by an OData Producer, the classes are then used in the PHP application to connect/edit/add/delete or browse records from the Data Service. Objects with methods and properties can be used instead of writing code that handles calling the service and parsing the data.
Some examples

/* connect to the OData service  */
   $svc = new NorthwindEntities(NORTHWIND_SERVICE_URL);
     
/* get the list of Customers in the USA, for each customer get the list of Orders */
    $query = $svc->Customers()
                 ->filter("Country eq 'USA'")
                 ->Expand('Orders');
    $customerResponse = $query->Execute();

/* get only CustomerID and CustomerName */
    $query = $svc->Customers()
                 ->filter("Country eq 'USA'")
                 ->Select('CustomerID, CustomerName');
    $customerResponse = $query->Execute();

/* create a new customer */
    $customer = Customers::CreateCustomers('channel9', 'CHAN9');
    $proxy->AddToCustomers($customer); 

/* commit the change on the server */        
    $proxy->SaveChanges();


Contributors

Persistent.jpg
Microsoft is the project sponsor and provides architectural guidance and best practices for this PHP Toolkit. Persistent Systems Ltd. is an award-winning technology company specialized in software product development services. The Company’s proven processes for entire product lifecycle helps customers increase revenue, margin and enhance brand value.

Last edited Mar 25, 2010 at 5:23 PM by claudioc, version 24