Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Tips and Tutorials
ORM with RESTful API as backend/storage
Hello fellow Fuelers,
I'm in search of a package or class that is similar to an ORM but doesn't use any kind of database as storage backend but rather a RESTful API.
Basically the package/class should behave similar to Fuel's ORM such that I can do something like `Model\User::query()->where('username', 'LIKE', 'admin')->get()` and this will trigger a cURL request to the defined API with proper formatted arguments.
The reason I am looking for this is to be able to write an API which can be used by both my webpage as well as third-party services or e.g., a native mobile app. With the current implementation (maybe just a dead lock in my brain) I cannot do this as my Fuel-app would be using the same models as the API is using which doubles the code to maintain given the API is a different app (separate code-base).
Has anybody ever seen anything like that out in the open? Or do I just go with having the same model code in two places?
Yes, but not in the wild.
We use a generic REST API in our application portfolio (which are distributed apps with central management). But I can't give that away I'm afraid.
That's what I thought, hoped though that pro-devs might know better about what's available in the wild
Just out of curiosity: is your implementation equivalent to fuel's orm package or striped down to the bare necessities?
It's pointless and not very efficient to replicate the API.
We implemented a subset mainly for CRUD operations and datatables (paginated lists).
I think the API should stay in control of what the client can see and do, if you expose a complete query API, you open yourself to abuse or worse.
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion