laravel 任何 PHP 框架都实现了 ODATA 协议?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24151768/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 09:37:48  来源:igfitidea点击:

Any PHP framework implements ODATA protocol?

phplaravelodatabreezejaydata

提问by Aladdin Mhemed

Is there any php framework that implements odata protocol, native or by extension?

是否有任何实现 odata 协议的 php 框架,原生的或扩展的?

I need to use breezejson the client and I hope I don't have to implement all the server side work of odata by myself.

我需要在客户端使用breedjs,希望不用自己实现odata的所有服务端工作。

in case there is no such thing, is there any alternative to breezejs?

万一没有这样的东西,有没有其他的东西可以代替breedjs?

jaydatais not an alternative, because actually it also requires the server side to implement odata protocol, so they are too similar.

jaydata不是替代品,因为实际上它也需要服务器端实现 odata 协议,所以它们太相似了。

Rest services, (like restangular in angularjs) are also not an alternative (not to me at least). They provide only a portion of the services of breezejs or jaydata. E.g. they don't provide caching data, change tracking or complicated rich query options.

休息服务(如 angularjs 中的 restangular)也不是替代品(至少对我来说不是)。它们仅提供了微风js 或jaydata 的部分服务。例如,它们不提供缓存数据、更改跟踪或复杂的丰富查询选项。

any ideas?

有任何想法吗?

thank you

谢谢你

回答by Steve Schmitt

Yes - there is an OData Producer Library for PHPwhich is available on github.

是的 -在github上有一个适用于 PHPOData Producer Library

That might be both more and less than you need. A Breeze client basically needs three things from the server:

这可能比您需要的多,也可能少。Breeze 客户端基本上需要来自服务器的三样东西:

  1. Metadata describing the object model (which may be written by hand). OData's metadata may be inadequate because it sometimes omits foreign keys.
  2. An way to handle saving changes (I don't think the OData Producer for PHP implements this).
  3. A way to respond to the queries that your application needs.
  1. 描述对象模型的元数据(可以手工编写)。OData 的元数据可能不足,因为它有时会省略外键。
  2. 一种处理保存更改的方法(我认为 PHP 的 OData Producer 没有实现这一点)。
  3. 一种响应应用程序所需查询的方法。

You don't necessarily need the a full OData implementation. Look into breeze.server.php; it might be what you need.

您不一定需要完整的 OData 实现。查看微风.server.php; 它可能是你需要的。

EDIT - breeze.server.phpactually uses the OData Producer Library.

编辑 -微风.server.php实际上使用OData Producer Library