Mix Database and Web Service Results


I have some virtual results that I get from a webService (Jobs).
I have a jobs table .
I want to mix those results I get from the webservice with the results I get from my table jobs.
I do not have the right to store the web service results in a table or file. And if I do injection, The pagination must work correctly.
Have you any suggestion to do that ? thanks


Hopefully you are just adding fields to the jobs result, that would make the most sense.

// get the results from the paginator:
$jobs = $this->paginate($query);

// add the data from the webService
foreach ($jobs as $key => $value)
$jobs[$key][‘param1’] = webService[’$job_key’][‘param1’];
$jobs[$key][‘param2’] = webService[’$job_key’][‘param2’];
$jobs[$key][‘param3’] = webService[’$job_key’][‘param3’];

This will add parameters param1, param2, param3 to each paginated jobs results record. Obviously, you have to make sure that you can match the webService record id (here $job_key) with the appropriate $jobs id in the $jobs results ($key).


May be it’s because of my english but this is not exactly what I want to do.
A job a get from the web service is different than a job a get from the database, what I want to do is mix the results .
Example : 10 results from the database and 15 results from the webservice will give a page with 25 results.


(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)