I currently have a query that results in the following recordset:
Array ( [Contestant] => Array ( [id] => 1 [name] => test [age] => [city] => atest [telephone] => [email] => [email protected] [why_model_house] => a [highschool] => [photo] => 5329_119145013633_512383633_2487923_7196193_n0.jpg [active] => 1 ) [0] => Array ( [Contestant_votes] => 4 ) [Vote] => Array ( [id] => 1 ) )
I can get the paginator->sort to work with every data in it except the "Contestant_votes" since it doesn't belong in a model it's currently in the Array[0]
I tried doing this :
<th><?php echo $paginator->sort('Votes', '0.Contestant_votes'); ?></th>
and this:
<th><?php echo $paginator->sort('Votes', 'Contestant_votes'); ?></th>
But it doesn't work. The conestants_votes field is generated by the following query:
'Contestant.*, count(Vote.contestant_id) as Contestant_votes'
So that's why it's not in a model. Is there a way to trick cakephp into thinking that Contestant_votes is part of the Contestant model or a way to add it to the paginator so I can sort it?
Thanks in advance,
Fabian Brenes