That's nice to do it in afterFind() But this is not adding a field in database actually. And paginate generates sql like this:
Order by 'Model'.'name' So how to proceed, when this field is in array, but not in database? On Jun 13, 10:51 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > set it in afterFind so it will be ['Link']['populraity'] = > $this->getPopularity() ? > or you can also make a custom paginate function in the model and add > the property there. > > On Fri, Jun 13, 2008 at 4:06 PM, Abhimanyu Grover > > > > <[EMAIL PROTECTED]> wrote: > > > After wasting whole day, I'm finally going to post it here. Let me > > share this problem.. > > > I have a model called Link. This model contains a few general fields > > like: > > id > > title > > url > > status > > > There's a new concept which we added is 'popularity' of a link. I can > > not store it inside a table. > > It is calculated using some deep analysis. Now my clients wants us to > > create a function which will sort a link based on its popularity, and > > also other fields. I'm stuck and not sure how can this be achieved > > using Controller::paginator() > > > Is there any workaround I can do? > > assuming popularity is returned by this $this->Link- > >>getPopularity($linkId) > > > Thanks, > > Abhimanyu Grover > > -- > Marcin Domanskihttp://kabturek.info --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
