If I have an ItemContainer class that contains, for example, items in an order, where each item is an Item object; is it best to have a method like:
that returns an array containing Item objects, or is it better practice to do something like:
which returns a single item object for that item number, and forgoes the array. I realise this may be a trivial question or simply one of preference, but I'd like my app to adopt best practices from the start and I'm unsure which way to proceed. I'm writing in PHP, but I figured this pretty much applies to any OOP language.