title: Symfony2: Transformation of database records for displaying
body: <p>I have rather theoretical question about proper approach of using Symfony though I believe the approach is to be same for any other PHP framework.</p>
  
  <p>I have tariff objects stored in database. I want to provide a cost model for each tariff basing on user input. </p>
  
  <p>My initial approach was to create an array, one's each element would contain data from corresponding tariff object and calculated data. All of that was done in controller's action method.</p>
  
  <p>Later I have created another class CostModel and then created an array CostModel[], which than was passed to $this->render() method. Again it's done in controller. </p>
  
  <p>This approach works well enough. However, since I have not much experience with Symfony, I have doubts that this approach - performing calculations in controller - is good one. </p>
  
  <p>Is there any better way for this?</p>