storyblok / storyblok-php-client

Storyblok - PHP Client
https://www.storyblok.com
MIT License
34 stars 37 forks source link

querystring regex for supporting [] #29

Closed christianzoppi closed 3 years ago

christianzoppi commented 3 years ago

This PR adds support for the filter_query_v2[__or][][field][operator]= type of query documented here. The new regex is replacing any [__or][number] in the querystring with [__or][]. I think it's safe to do as nobody can name a field __or so it won't break any existing situation.

How to test this

Here is an example of query that you can use:

$client->getStories(['filter_query_v2' => ["__or" => [
    ["fieldname" => ["in" => "value1"]], 
    ["fieldname" => ["in" => "value2"]]
]]]);