public function whereBrackets(Closure $callback, $operator = 'AND')
    {
        if ( ! in_array($operator, ['AND', 'OR'])) {
            throw new \InvalidArgumentException("Logical operator");
        }
        // first time call where ?
        if ($this->_where_str == '') {
            $this->_where_str = ' WHERE ( ';
        } else {
            $this->_where_str .= ' '.$operator.' ( ';
        }
        $sub_attr = $this->_subBuilder($callback);

        $this->_where_str .= preg_replace('/WHERE/', '', $sub_attr['_where_str'], 1).' ) ';

        return $this;
    }
public function whereBrackets(Closure $callback, $operator = 'AND')
    {
        if ( ! in_array($operator, ['AND', 'OR'])) {
            throw new \InvalidArgumentException("Logical operator");
        }
        // first time call where ?
        if ($this->_where_str == '') {
            $this->_where_str = ' WHERE ( ';
        } else {
            $this->_where_str .= ' '.$operator.' ( ';
        }
        $sub_attr = $this->_subBuilder($callback);

        $this->_where_str .= preg_replace('/WHERE/', '', $sub_attr['_where_str'], 1).' ) ';

        return $this;
    }
public function whereBrackets ( Closure $ callback , $ operator = 'AND' ) { if ( ! in_array ( $ operator , [ 'AND' , 'OR' ] ) ) { throw new \ InvalidArgumentException ( "Logical operator" ) ; } // first time call where ? if ( $ this -> _where_str == '' ) { $ this -> _where_str = ' WHERE ( ' ; } else { $ this -> _where_str .= ' ' . $ operator . ' ( ' ; } $ sub_attr = $ this -> _subBuilder ( $ callback ) ; $ this -> _where_str .= preg_replace ( '/WHERE/' , '' , $ sub_attr [ '_where_str' ] , 1 ) . ' ) ' ; return $ this ; }
build whereBrackets string

@param  \Closure $callback
@param  string $operator
@return  self
@throws  \InvalidArgumentException
build whereBrackets string