PHP code example of rdrei / odata

1. Go to this page and download the library: Download rdrei/odata library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rdrei / odata example snippets


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

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

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

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

    $entityHandler->Insert($entity);

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

    $entityHandler->Delete($key);