I would have the product
object initialize three member vars when it is constructed: $sale_price
, and $cost_price
. Each having the obvious accessors get_sale_price()
, and get_cost_price()
. And, I would leave it up to whatever is using the product
object to choose which price is appropriate to it's needs.
Is there a specific reason you cannot do it that way? Are applications alrady using the get_price() call and expecting the product object to return the appropriate price?