Anyone?
On Jul 3, 8:41 pm, gerbenzomp <[EMAIL PROTECTED]> wrote:
> I have the following beforefilter, to make sure some queries have the
> additional condition "WHERE sitename = 'x'".
>
> function beforeFind(&$queryData) {
>
> if ($this->hasField('siteindex') && !in_array('siteindex',
> array_keys($queryData)) && !in_array($this->name . '.siteindex',
> array_keys($queryData))) {
> $queryData['conditions'][$this->name . '.siteindex'] =
> Configure::read('siteid');
> }
>
> return $queryData;
>
> }
>
> The beforefilter looks okay to me, but in some cases queries turn out
> like this:
>
> ...WHERE 1HERE layerid = '2' AND siteindex = '1' ORDER BY `order_id`
> ASC, `id` ASC;
>
> (look at the 1HERE part)
>
> And thus I get mysql errors.
>
> What am I doing wrong?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---