I have a new CakePHP install and I have a series of Web Service Endpoints in JSON, is it possible to populate a Model from this JSON in CakePHP?
They won't be connecting to a DB as all data comes from and submits to the web service.
I have no code as I cannot find any documentation on the CakePHP Models Site.
Rest datasource
The storage mechanism that a model uses is a datasource. By default Cake assumes a model will be used with a database but it can be anything that extends the
Datasource
class. There's an example in the documentation of a simple REST api datasource, and there are many more datasources in the community datasources repository.It's not necessary to build your own REST datasource though, there are existing solutions out there such as this one which make using a model with a REST api rather trivial.
Examples from the readme: