简体   繁体   English

symfony2:从Web服务加载实体

[英]symfony2: loading entities from web services

I need to load entities from a REST web service in the same way as I would from a database using Doctrin ORM. 我需要以与使用Doctrin ORM从数据库加载数据库相同的方式从REST Web服务加载实体。

Creating REST web services in Symfony is really well documented but I canlt see anythign about consuming them. 在Symfony中创建REST Web服务的文档确实很丰富,但是我看不到有任何使用它们的地方。

I've written losts of apps in straight PHP that load data from REST services but I'm sure there must me a bundle in Symfony that will do it for me in the same way as Doctrin ORM allows me to map to and from databases. 我已经用直接的PHP编写了一些应用程序,这些应用程序从REST服务中加载数据,但是我敢肯定,我必须在Symfony中捆绑一个捆绑包,以与Doctrin ORM允许我映射数据库的方式相同。

Is there something I'm missing or do I need to write my own custom repsitories to load entities from web services? 是否有我缺少的东西,或者我需要编写自己的自定义目录从Web服务中加载实体?

you can use a PHP HTTP client framework like guzzle, take a look at : 您可以使用像guzzle这样的PHP HTTP客户端框架,来看看:

https://github.com/misd-service-development/guzzle-bundle https://github.com/misd-service-development/guzzle-bundle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM