Wednesday, January 18, 2012

Re: sorting

I resolved this myself:

function sundown($season,$race,$sex,$class,$team)
{
if ($season ==null){$conditions = array('Result.location' =>
'Sundown');}
else if ($race ==null) {$conditions = array('Result.location' =>
'Sundown','Result.season'=>$season);}
else if ($sex ==null) {$conditions =
array('Result.location'=>'Sundown', 'Result.season'=>$season,
'Result.racenum'=>$race);}
else if ($class ==null) {$conditions =
array('Result.location'=>'Sundown', 'Result.season'=>$season,
'Result.racenum'=>$race,'Result.sex'=>$sex);}
else if ($team ==null) {$conditions =
array('Result.location'=>'Sundown', 'Result.season'=>$season,
'Result.racenum'=>$race,'Result.sex'=>$sex,'Result.class'=>$class);}
else {$conditions = array('Result.location'=>'Sundown',
'Result.season'=>$season, 'Result.racenum'=>$race,'Result.sex'=>
$sex,'Result.class'=>$class,'Result.team'=>$team);}

$params = array(
'conditions' => $conditions,
'order' => array('Result.racenum', 'Result.bib ASC'),
);

$this->set('results',$this->Result->find('all',$params));


}

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate