I'm assuming you want an OR -- Dr. Loboto's produce an AND condition.
LIKE plural AND LIKE singular doesn't make a whole lot of sense.  You
probably want LIKE plural OR LIKE singular to be found in the
description.

$conditions = array(
  'OR' => array(
    array('Product.short_description LIKE' => "%_ $plural _%"),
    array('Product.short_description LIKE' => "%_ $singular _%")
  )
);

$this->paginate($conditions);

That will get you what you want,
Nick

On Dec 23, 2:54 am, "Dr. Loboto" <[email protected]> wrote:
> array(
>   array('Product.short_description LIKE' => "%_ $plural _%"),
>   array('Product.short_description LIKE' => "%_ $singular _%")
> )
>
> On 22 дек, 18:35, Christopher Geheran <[email protected]> wrote:
>
>
>
>
>
>
>
> > So, I am attempting to have multiple like conditions on the same
> > field, as follows, and Im sending this into the pagination class.
>
> > array(
> >    'Product.short_description LIKE' => array("%_ $plural _%", "%_
> > $singular _%")
> > )
>
> > Since the above is an array, cakephp is attempting to add the IN
> > clause into the sql, which makes perfect sense-- but, obviously does
> > not work for a LIKE condition.
>
> > Since its an array, you can not do this:
>
> > array(
> >    'Product.short_description LIKE' => "%_ $plural _%",
> >    'Product.short_description LIKE' => "%_ $singular _%"
> > )
>
> > You cannot do this because the Keys are the same, so you only end up
> > with the last key in the SQL. I attempted making the entire thing an
> > array, like this:
>
> > array(
> >    '0'=>'Product.short_description LIKE' => "%_ $plural _%",
> >    '1'=>'Product.short_description LIKE' => "%_ $singular _%"
> > )
>
> > Cake didn't seem to like that either.
>
> > Any suggestions?
>
> > Thanks,
>
> > Chris

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to