Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query operators fail to handle arrays with null values #262

Open
marcojetson opened this issue Feb 27, 2018 · 1 comment
Open

Query operators fail to handle arrays with null values #262

marcojetson opened this issue Feb 27, 2018 · 1 comment

Comments

@marcojetson
Copy link
Contributor

$where = ['user_id' => [1, 2, null]]

gets converted into

WHERE user_id IN (1, 2, null)

instead of

user_id IN (1, 2) OR user_id IS NULL

@FlipEverything
Copy link
Contributor

We have to look into this. In the meantime could you please test if the following code is working for you?

// untested
$spot->mapper($entityName)->where(['user_id' => [1, 2]])->orWhere(['user_id' => null]]);

In the future we have to cover this case with tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants