title: How can I programmatically create nested where clauses with Zend\Db\Sql component?
body: <p>I've tried using the following code to accomplish it, but the unnest function returns an error:</p>
  
  <pre><code>foreach($params as $key=&gt;$param) {
      if(strpos($param, ',') !== false) {
          $where = new \Zend\Db\Sql\Where();
  
          $where-&gt;nest();
          $param_arr = explode(',', $param);
  
          $entered_once = 0;
          foreach($param_arr as $p) {
              $where-&gt;equalTo($key, $p);
              if($entered_once &lt; count($param_arr)) {
                  $where-&gt;or;
              }
              $entered_once++;
          }
          $where-&gt;unnest();
          $select-&gt;where($where);
      }
      else {
          $select-&gt;where(array($key =&gt; $param));
      }
  }   
  </code></pre>