protected function translateWhere($wheres)
    {
        $build = '';

        foreach ($wheres as $where) 
        {
            // to make nested wheres possible you can pass an closure
            // wich will create a new query where you can add your nested wheres
            if (!isset($where[2]) && isset( $where[1] ) && $where[1] instanceof BaseQuery ) 
            {
                $subAttributes = $where[1]->attributes();

                // The parameters get added by the call of compile where
                $build .= ' ' . $where[0] . ' ( ' . substr($this->translateWhere($subAttributes['wheres']), 7) . ' )';

                continue;
            }

            // when we have an array as where values we have
            // to parameterize them
            if (is_array($where[3])) 
            {
                $where[3] = '(' . $this->parameterize($where[3]) . ')';
            } else {
                $where[3] = $this->param($where[3]);
            }

            // we always need to escepe where 1 wich referrs to the key
            $where[1] = $this->escape($where[1]);

            // implode the beauty
            $build .= ' ' . implode(' ', $where);
        }

        return $build;
    }
protected function translateWhere($wheres)
    {
        $build = '';

        foreach ($wheres as $where) 
        {
            // to make nested wheres possible you can pass an closure
            // wich will create a new query where you can add your nested wheres
            if (!isset($where[2]) && isset( $where[1] ) && $where[1] instanceof BaseQuery ) 
            {
                $subAttributes = $where[1]->attributes();

                // The parameters get added by the call of compile where
                $build .= ' ' . $where[0] . ' ( ' . substr($this->translateWhere($subAttributes['wheres']), 7) . ' )';

                continue;
            }

            // when we have an array as where values we have
            // to parameterize them
            if (is_array($where[3])) 
            {
                $where[3] = '(' . $this->parameterize($where[3]) . ')';
            } else {
                $where[3] = $this->param($where[3]);
            }

            // we always need to escepe where 1 wich referrs to the key
            $where[1] = $this->escape($where[1]);

            // implode the beauty
            $build .= ' ' . implode(' ', $where);
        }

        return $build;
    }
protected function translateWhere ( $ wheres ) { $ build = '' ; foreach ( $ wheres as $ where ) { // to make nested wheres possible you can pass an closure // wich will create a new query where you can add your nested wheres if ( ! isset ( $ where [ 2 ] ) && isset ( $ where [ 1 ] ) && $ where [ 1 ] instanceof BaseQuery ) { $ subAttributes = $ where [ 1 ] -> attributes ( ) ; // The parameters get added by the call of compile where $ build .= ' ' . $ where [ 0 ] . ' ( ' . substr ( $ this -> translateWhere ( $ subAttributes [ 'wheres' ] ) , 7 ) . ' )' ; continue ; } // when we have an array as where values we have // to parameterize them if ( is_array ( $ where [ 3 ] ) ) { $ where [ 3 ] = '(' . $ this -> parameterize ( $ where [ 3 ] ) . ')' ; } else { $ where [ 3 ] = $ this -> param ( $ where [ 3 ] ) ; } // we always need to escepe where 1 wich referrs to the key $ where [ 1 ] = $ this -> escape ( $ where [ 1 ] ) ; // implode the beauty $ build .= ' ' . implode ( ' ' , $ where ) ; } return $ build ; }
Translate the where statements into sql

@param array                 $wheres
@return string
Translate the where statements into sql