odata client php
0.7.4
一個流利的圖書館,用於調用由Laravel查詢構建器啟發和基於啟發的ODATA REST服務。
該庫當前正在預覽中。當我們迭代製作支持的圖書館時,請繼續提供反饋。
對於WordPress用戶,請參閱我們的重力表格Dynamics 365附加組件。
您可以使用作曲家安裝PHP SDK。
composer require saintsystems/odata-client
以下是顯示如何調用ODATA服務的示例。
<?php
require_once __DIR__ . ' /vendor/autoload.php ' ;
use SaintSystems OData ODataClient ;
class UsageExample
{
public function __construct ()
{
$ odataServiceUrl = ' https://services.odata.org/V4/TripPinService ' ;
$ odataClient = new ODataClient ( $ odataServiceUrl );
// Retrieve all entities from the "People" Entity Set
$ people = $ odataClient -> from ( ' People ' )-> get ();
// Or retrieve a specific entity by the Entity ID/Key
try {
$ person = $ odataClient -> from ( ' People ' )-> find ( ' russellwhyte ' );
echo " Hello, I am $ person -> FirstName " ;
} catch ( Exception $ e ) {
echo $ e -> getMessage ();
}
// Want to only select a few properties/columns?
$ people = $ odataClient -> from ( ' People ' )-> select ( ' FirstName ' , ' LastName ' )-> get ();
}
}
$ example = new UsageExample ();從基本目錄運行供應vendor/bin/phpunit 。
文件
Wiki
例子
ODATA網站
Oasis ODATA版本4.0文檔
在回購中的“問題”選項卡上查看或日誌問題。
版權(C)Saint Systems,LLC。版權所有。根據MIT許可獲得許可。