{
  "meta": {
    "$_GET": [
      {
        "type": "text",
        "name": "sort"
      },
      {
        "type": "text",
        "name": "dir"
      }
    ]
  },
  "exec": {
    "steps": [
      {
        "name": "",
        "module": "auth",
        "action": "restrict",
        "options": {
          "provider": "security",
          "permissions": [
            "Active"
          ]
        }
      },
      {
        "name": "brand",
        "module": "dbconnector",
        "action": "select",
        "options": {
          "connection": "db",
          "sql": {
            "type": "SELECT",
            "columns": [
              {
                "table": "collections",
                "column": "id"
              },
              {
                "table": "collections",
                "column": "name"
              }
            ],
            "params": [],
            "table": {
              "name": "diecast_cars"
            },
            "primary": "id",
            "joins": [
              {
                "table": "collections",
                "column": "*",
                "type": "INNER",
                "clauses": {
                  "condition": "AND",
                  "rules": [
                    {
                      "table": "collections",
                      "column": "id",
                      "operation": "=",
                      "operator": "equal",
                      "value": {
                        "table": "diecast_cars",
                        "column": "vehicle_brand_id",
                        "type": "number"
                      }
                    }
                  ]
                },
                "primary": "id"
              }
            ],
            "query": "select distinct `collections`.`id`, `collections`.`name` from `diecast_cars` inner join `collections` on `collections`.`id` = `diecast_cars`.`vehicle_brand_id` order by `collections`.`name` ASC",
            "orders": [
              {
                "table": "collections",
                "column": "name",
                "direction": "ASC",
                "recid": 1
              }
            ],
            "distinct": true
          }
        },
        "output": true,
        "meta": [
          {
            "type": "number",
            "name": "id"
          },
          {
            "type": "text",
            "name": "name"
          }
        ],
        "outputType": "array"
      },
      {
        "name": "series",
        "module": "dbconnector",
        "action": "select",
        "options": {
          "connection": "db",
          "sql": {
            "type": "SELECT",
            "columns": [
              {
                "table": "collections",
                "column": "id"
              },
              {
                "table": "collections",
                "column": "name"
              }
            ],
            "params": [],
            "table": {
              "name": "diecast_cars"
            },
            "primary": "id",
            "joins": [
              {
                "table": "collections",
                "column": "*",
                "type": "INNER",
                "clauses": {
                  "condition": "AND",
                  "rules": [
                    {
                      "table": "collections",
                      "column": "id",
                      "operator": "equal",
                      "operation": "=",
                      "value": {
                        "table": "diecast_cars",
                        "column": "series",
                        "type": "number"
                      }
                    }
                  ]
                },
                "primary": "id"
              }
            ],
            "query": "select distinct `collections`.`id`, `collections`.`name` from `diecast_cars` inner join `collections` on `collections`.`id` = `diecast_cars`.`series` order by `collections`.`name` ASC",
            "orders": [
              {
                "table": "collections",
                "column": "name",
                "direction": "ASC"
              }
            ],
            "distinct": true
          }
        },
        "output": true,
        "meta": [
          {
            "type": "number",
            "name": "id"
          },
          {
            "type": "text",
            "name": "name"
          }
        ],
        "outputType": "array",
        "collapsed": true
      },
      {
        "name": "manufacturer",
        "module": "dbconnector",
        "action": "select",
        "options": {
          "connection": "db",
          "sql": {
            "type": "SELECT",
            "columns": [
              {
                "table": "collections",
                "column": "id"
              },
              {
                "table": "collections",
                "column": "name"
              }
            ],
            "params": [],
            "table": {
              "name": "diecast_cars"
            },
            "primary": "id",
            "joins": [
              {
                "table": "collections",
                "column": "*",
                "type": "INNER",
                "clauses": {
                  "condition": "AND",
                  "rules": [
                    {
                      "table": "collections",
                      "column": "id",
                      "operator": "equal",
                      "operation": "=",
                      "value": {
                        "table": "diecast_cars",
                        "column": "brand_id",
                        "type": "number"
                      }
                    }
                  ]
                },
                "primary": "id"
              }
            ],
            "query": "select distinct `collections`.`id`, `collections`.`name` from `diecast_cars` inner join `collections` on `collections`.`id` = `diecast_cars`.`brand_id` order by `collections`.`name` ASC",
            "orders": [
              {
                "table": "collections",
                "column": "name",
                "direction": "ASC",
                "recid": 1
              }
            ],
            "distinct": true
          }
        },
        "output": true,
        "meta": [
          {
            "type": "number",
            "name": "id"
          },
          {
            "type": "text",
            "name": "name"
          }
        ],
        "outputType": "array",
        "collapsed": true
      }
    ]
  }
}