I have my first OOP build. I've got several classes but the ones that apply to this questions are
The product class is what you'd expect. Creating an object for each product. Got lots of getters and setters but not so many methods yet. It has your expected properties such as name, price, description, image etc etc
ProductList is a collection of products. This is what it'll use to show items on my website by looping through my collection. I have a method called, getById where I pass in an ID and it returns a single product object. This is how I'll show a single product on a product page.
Is it okay to call this from my database on every page load or should I be saving it to a XML file using CRON or included scripts when my database is updated etc?
SalesManager is an object that when initiated, will find if there's any particular sale on for today's date. If there is it'll look up what the discount is. A set percentage or monetary value and what products it applies too.
Should I be calling SalesManager when I create my productList or should I run the price through the SalesManager class as echo it onto the screen via a Product method maybe $product->applyDiscount()?
I'm thinking the later as I may want to show the original price as well as the discounted price?
Have I got this all VERY wrong.