QueryBuilderParser icon indicating copy to clipboard operation
QueryBuilderParser copied to clipboard

Custom bindings for fields

Open curunoir opened this issue 6 years ago • 1 comments

Hello, it would be helpful to be able to create bindings for fields similarly at what is done for JoinSupportingQueryBuilderParser. If I store some values within json columns I can't use the parser to filter on these fields easily. Something like that could be usefull :

$bindingsFields = array(
        'myjsonfield1' => array(
            'from_table'      => 'table1',
            'from_col'        => 'json_col',
            'json_path'        => 'json_fields->myjsonfield1->myjsonfield1->value' // should be optional if field is not within a json column
        ),

curunoir avatar Jul 26 '18 12:07 curunoir

you can access json fields like this

{
  "condition": "OR",
  "rules": [
    {
      "id": "firstname",
      "field": "fields->first_name",
      "type": "string",
      "input": "text",
      "operator": "equal",
      "value": "hhh"
    },
    {
      "id": "tel",
      "field": "fields->tel",
      "type": "string",
      "input": "text",
      "operator": "equal",
      "value": "77"
    }
  ],
  "valid": true
}

geo903 avatar Oct 21 '23 11:10 geo903