Custom Classes

Hi,

I have a situation where I’d like to display a summary of Bids for a particular Post. There are several fields including lastBidDate, bidCount, averageBidsPerDay etc… My idea is to create a class, called BidSummary, pass it a Post object and have the class calculate the fields. I would then simply call the public properties in my views.

Is this a viable solution? In what folder do I create my custom classes. Would it be a Model?

Cheers.

I am not sure this can be a Model, Unless you put the logic you are willing to do inside the Post model your fetching the data from. Depends on the type of manipulation your about to do on the data, You can create a class to handle that inside the protected/components or protected/modules/moduleID/components (Or create it as an extension and place it under protected/extensions) and extend from either CApplicationComponent or CExtController.