On 10/2/07, cmbg <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> Is there a library or some add-on for cake that will help parse a text
> field to be used as conditions in a query?
>
> Like if someone wanted to look for a book with the following keyword
> string -- "New York" wiz* *way*
>
> the query becomes like this
>
> SELECT *
> FROM books Book
> WHERE Book.title='New York' OR Book.title LIKE "wiz%" OR Book.title
> LIKE "%way%"
>
> Or if anyone has any tips on how to get this done, I'd appreciate it!
>

Well, I've been working on something similar to that the past few days
and you might want to take a look at putting the parsing into a
beforeFind, building your condition string and assigning it to
$this->Model->conditions.

Hope that helps.

-- 
Chris Hartjes
Cake Development Corporation
http://www.cakedevelopment.com

My motto for 2007:  "Just build it, damnit!"

@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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