This site uses tracking cookies. By using this site, you agree to our Privacy Policy. If you don't opt in, some parts of the site might not function.
Blog
Home / Blog / Web Applications / Writing the Doctrine Integration for Apigility
30Mar 2014

Writing the Doctrine Integration for Apigility

About the Author

Comments (2)

Eugene - September 30, 2014

Can’t see UI for admin.

Reply
Stuardo Rodríguez - November 1, 2014

So, I’m trying to get my head around Apigility. I already have a module that users DoctrineModule to interact with the DB. I created a new module called “Api”, and created my first REST service. I would like to pulish the data my first module already interacts with, in the REST service. I saw that Apigility generates a /module/Api/V1/Rest/MyService/MyServiceResource.php with the fetchAll() and fetch($id) methods.

I understand THAT’S what I need to replace to send my Doctrine entities, but all thest I’ve done have failed. I started trying a simple

public function fetch($id)
{
return [‘foo’ => ‘bar’];
}

That simple exampel worked for the RPC service, but not for the REST services.

What am I doing wrong? What should the fetch($id) method return?

Thanks. I’m a bit desperate.

Reply

Leave a Reply