public function whereInSub($field, Closure $callback, $condition = 'IN', $operator = 'AND')
    {
        if ( ! in_array($condition, ['IN', 'NOT IN']) || ! in_array($operator, ['AND', 'OR'])) {
            throw new \InvalidArgumentException("Error whereIn mode");
        }
        // first time call where ?
        if ($this->_where_str == '') {
            $this->_where_str = ' WHERE '.self::_wrapRow($field).' '.$condition.' ( ';
        } else {
            $this->_where_str .= ' '.$operator.' '.self::_wrapRow($field).' '.$condition.' ( ';
        }

        $sub_attr = $this->_subBuilder($callback);
        $this->_where_str .= $sub_attr['_prepare_sql'].' ) ';

        return $this;
    }
public function whereInSub($field, Closure $callback, $condition = 'IN', $operator = 'AND')
    {
        if ( ! in_array($condition, ['IN', 'NOT IN']) || ! in_array($operator, ['AND', 'OR'])) {
            throw new \InvalidArgumentException("Error whereIn mode");
        }
        // first time call where ?
        if ($this->_where_str == '') {
            $this->_where_str = ' WHERE '.self::_wrapRow($field).' '.$condition.' ( ';
        } else {
            $this->_where_str .= ' '.$operator.' '.self::_wrapRow($field).' '.$condition.' ( ';
        }

        $sub_attr = $this->_subBuilder($callback);
        $this->_where_str .= $sub_attr['_prepare_sql'].' ) ';

        return $this;
    }
public function whereInSub ( $ field , Closure $ callback , $ condition = 'IN' , $ operator = 'AND' ) { if ( ! in_array ( $ condition , [ 'IN' , 'NOT IN' ] ) || ! in_array ( $ operator , [ 'AND' , 'OR' ] ) ) { throw new \ InvalidArgumentException ( "Error whereIn mode" ) ; } // first time call where ? if ( $ this -> _where_str == '' ) { $ this -> _where_str = ' WHERE ' . self :: _wrapRow ( $ field ) . ' ' . $ condition . ' ( ' ; } else { $ this -> _where_str .= ' ' . $ operator . ' ' . self :: _wrapRow ( $ field ) . ' ' . $ condition . ' ( ' ; } $ sub_attr = $ this -> _subBuilder ( $ callback ) ; $ this -> _where_str .= $ sub_attr [ '_prepare_sql' ] . ' ) ' ; return $ this ; }
build whereInSub string

@param  string $field
@param  \Closure $callback
@param  string $condition
@param  string $operator
@return  self
@throws  \InvalidArgumentException
build whereInSub string