Are these the conditions for a model related by a HasMany relationship? Most
probably CakePHP is using PHP's empty() function [http://php.net/empty] to
check the value of the foreignKey.

If that's the case, you may want to fill a ticket, but I doubt they would
fix it as it would change the current behavior.

Cheers,
- Johan

On Tue, Jun 28, 2011 at 1:49 AM, Krissy Masters
<[email protected]>wrote:

>  I am submitting a value thru a form, based on the value a var is passed
> to the query.****
>
> ** **
>
> function getValueSub( $data) {****
>
> $primary = ( $data['primary'] == 4) ? array(0,1,2) : $data['primary']; ***
> *
>
> return array($this->alias . '.primary' => $primary);****
>
> }****
>
> ** **
>
> But if zero is the value submitted its not passed to the query. The
> statement for this condition is completely left out of the query.****
>
> ** **
>
> What am I doing wrong here? If 1 or 2 or 4 are passed no problem but if the
> form select box is opted for the option with the value of zero it does not
> work****
>
> ** **
>
> ** **
>
> K****
>
> ** **
>
> ** **
>
> --
> 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
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to