Hey all, I'm building an app with a number of rest apis that feed into orm models. I'm considering different strategies to abstract the layer that:
1) receives the data from the input obj,
2) validates/sets defaults,
3) then inserts/updates.
I'm looking for a good pattern that abstracts this cleanly and keeps good separation of model and controller responsibilities.
Currently, all of my rest apis extend my custom Controller_Api_Base, which extends Controller_Rest. I'm thinking of creating a getFromInput() function that looks through the Input values, compares them with the list of fields from the model, fills in defaults, then creates and returns the model.
Anyone have thoughts on this layer or know of any examples I can look at?
Thanks in advance,
David