title: CakePHP paginate 'virtual' field
body: <p>I have a model <strong>Item</strong> with its corresponding table <strong>items</strong> and fields (field1, field2, etc).</p>
  
  <p>I have another model, <strong>Comment</strong>, whith also its table and fields. One of the fields is <strong>item_rating</strong>, where users enter a number between 0 to 10 to rate the item.</p>
  
  <p>Both models are related like <strong>Item</strong> <em>hasMany</em> <strong>Comment</strong>, and <strong>Comment</strong> <em>belongsTo</em> <strong>Item</strong>.</p>
  
  <p>When paginating the <strong>Item</strong> model in the view, I would like to add the field <strong>item_rating</strong> along with its own fields, so users can see an average rating of the item and be able to sort by <strong>item_rating</strong>, apart from all the other fields that belong directly to <strong>Item</strong>.</p>
  
  <p>To do this, I figure I would need 2 things:</p>
  
  <ul>
  <li>Be able to create the <strong>item_rating</strong> field <em>on the fly</em> with the average of all its ratings</li>
  <li>Be able to add that field to the pagination so users can see it and sort by it</li>
  </ul>
  
  <p>Is this possible? Can anyone point me to the right direction of how to accomplish it? Or should I just add a <em>real</em> <strong>item_rating</strong> field to my <strong>items</strong> table and update the average everytime a new rating is added by a user?</p>
  
  <p>Thanks so much in advance!</p>