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

Search for array values #75

Open
ursulnegrul opened this issue Mar 24, 2019 · 2 comments
Open

Search for array values #75

ursulnegrul opened this issue Mar 24, 2019 · 2 comments

Comments

@ursulnegrul
Copy link

ursulnegrul commented Mar 24, 2019

Given a Jig mapper:

{
"set": 123,
"opt": [
            4,
            5,
            6
        ],
}

How can I search using IN array

 $Obj->load([
'set = :set AND :opt IN opt',
 ':set' => 123,
 ':opt' => 5
]);

I guess is not possible and I should use relationships?

@ikkez
Copy link
Owner

ikkez commented Mar 26, 2019

Well it would be possible with the raw Jig Mapper, but there's no handy feature in the cortex query parser that would help here. however, you can write it as php filter instead, try:
$obj->load(['set = :set and in_array(:opt,@opt)', ':set'=> 123, ':opt'=> 5]).

Not tested though.

@ursulnegrul
Copy link
Author

Nope, it searches for the "in_array" column.

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

No branches or pull requests

2 participants