I work with CakePHP 2.0. I made a new function sort and had no problem, if I take the table fields. But if I want to calculate something and give the result (method: 'Participant.year'=>'calculateyear' ) in my sort method, I have no result on my view.
function sort() {
$participants = $this->Participant->find('all', array(
'conditions'=>array('Participant.sex'=>'m','Participant.year'=>'calculateyear'),
'order'=>array('Participant.communitieRank'=>'ASC','Communitie.name'=>'ASC')
));
$this->set('participants', $participants);
}
function calculateyear ($jahr) {
$jahr = '2000';
return $jahr;
}