In my schema there are a few redundant columns used to speed up report queries. For example, the purchase total of a sale is saved in the "purchase_total" column of the "sale" table, yet in the model, it is calculated dynamically by adding up the sold price of each item purchase in the sale. This value can be retrieved by calling the "getPurchaseTotal" accessor on a Sale object.
Is there a way to map this value to the purchase_total column in the sale table when inserting/updating but NOT have it included in the hydration of a Sale object when loading from the database? I guess it's similar to a derived or calculated column but in reverse.
Is it just best to handle this via triggers in the database itself?