I'm working on a project where we use views to create a interface/layer between another system which is a datasource but have no matching model. This way, in my system, these views are in fact models. Everything is working perfectly fine until now, except for this part:
-------------------------------
|Table |Table |View |
-------------------------------
|Order > |OrderItem > |Item |
-------------------------------
Relation: Order (has many)> OrderItem (has many)> Item.
I recently faced a problem where it tries to save the entire set of relations of a table (the order). The system is supposed to save the order and its items (order-items). But somehow the save ends up hiting an update on the item model which is a view and returns this error, obviously:
Code:
$order->save();
Error:
Data manipulation operation not legal on this view : UPDATE ITEM (...)
Is there a way to track this, forcing it to not occur, or set it as a read only model?