// General conditions for the query
$conditions = array( 'Institute.conversions' => 'yes',
'Institute.brochure_pay_amount >' => 0,
'Training.id' => $highestRatedTrainingIds,
'1 = 1 GROUP BY Training.id'
);
Sorry that I can't tell you why it fails :-/
On Fri, Aug 28, 2009 at 10:50 AM, schneimi<michael.schneidt@arcor.de> wrote:
>
> Hi,
>
> I have an array with some ids of a model and struggle with getting
> them into a find condition.
>
> This is what I currently use, it works but is not very caky:
>
> $audioIds = array('1', '2', '3',....);
> $audios = $this->Audioplaylist->Audio->find('all', array('conditions'
> => 'Audio.id='.implode(' OR Audio.id=', $audioIds)));
>
> I think it should look like this the cake way:
>
> $audios = $this->Audioplaylist->Audio->find('all', array('conditions'
> => array('Audio.id' => $audioIds)));
>
> but this results in [...] AND `Audio`.`id`=Array [...]
>
> I already had a look into the cookbook and played around alot, but
> couldn't figure out a proper way, so I hope you can help me.
>
> Thx,
> Michael
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment