Open
Description
Request
Update FIMAdapter methods to respond with a simplified/flattened object.
Task
- Add
mapEntriesToModel
around the response for each Adapter method in theFIMAdapter
Class (SeePIMAdapter
Class for reference of usage). - Update to make to the
mapEntriesToModel
function to ensure the Faculty ("faculty" case should be "profile" instead) model is setup appropriately.
There's a method setup for getting all Contentful Entries (getAllContentfulEntries.php
) that utilizes this function to map Contentful API's paginated responses to a PHP model class matching the content type. This flattens the response so that you can write relationships like program.banner.college.name
instead of program.fields.banner.fields.college.fields.name
.