Skip to content

Latest commit

 

History

History
68 lines (54 loc) · 1.5 KB

README.MD

File metadata and controls

68 lines (54 loc) · 1.5 KB

rdrei/odata

travis-ci Latest Stable Version Total Downloads License

A small PHP OData Client based on guzzlehttp.

Install

    composer require rdrei/odata

Usage

Import the ODataClient

    use \rdrei\odata\ODataClient;
    use \rdrei\odata\ODataQuery;

Create a ODataClient and a EntityHandler.

    $client = new ODataClient([
        'url' => "https://<odata-server>/"
    ]);

    $entityHandler = $client->CreateHandler("EntityName");

Get

Get Enitities with a Query.

    $query = new ODataQuery();
    $query = $query->skip(0)->take(10);
    
    $result = $entityHandler->Get($query);

Insert

Create a new Entity.

    $entityHandler->Insert($entity);

Update

Patch a Entity.

    $entityHandler->Update($key, $entity);

Delete

Remove a Entity by Key.

    $entityHandler->Delete($key);

Run Test

    git clone ...
    composer install
    ./vendor/bin/phpunit

Documentation and Ressources