public function values(array $values) : QueryBuilder
    {
        $args    = func_get_args();
        $columns = [];
        $_values = [];

        foreach($values as $key => $value) {
            preg_match("/\(JSON\)\s*([\w]+)/i", $key, $jsonTag);

            if(
                is_array($value) ||
                is_object($value)
            ) {
                if(isset($jsonTag[0])) {
                    $key       = preg_replace('/\(JSON\)\s*([\w]+)/i', '$1', $key);
                    $_values[] = $this->getQuoted(json_encode($value));
                } else {
                    $_values[] = $this->getQuoted(serialize($value));
                }
            } else if(is_bool($value)) {
                $_values[] = ($value ? 1 : 0);
            } else if(is_null($value)) {
                $_values[] = "NULL";
            } else {
                $_values[] = $this->getQuoted($value);
            }

            $columns[] = "`". $this->sanitize($key) ."`";
        }

        $this->_query[] = "(". implode(", ", $columns) .")";
        $this->_query[] = "VALUES";
        $this->_query[] = "(". implode(", ", $_values) .")";

        return $this;
    }
public function values(array $values) : QueryBuilder
    {
        $args    = func_get_args();
        $columns = [];
        $_values = [];

        foreach($values as $key => $value) {
            preg_match("/\(JSON\)\s*([\w]+)/i", $key, $jsonTag);

            if(
                is_array($value) ||
                is_object($value)
            ) {
                if(isset($jsonTag[0])) {
                    $key       = preg_replace('/\(JSON\)\s*([\w]+)/i', '$1', $key);
                    $_values[] = $this->getQuoted(json_encode($value));
                } else {
                    $_values[] = $this->getQuoted(serialize($value));
                }
            } else if(is_bool($value)) {
                $_values[] = ($value ? 1 : 0);
            } else if(is_null($value)) {
                $_values[] = "NULL";
            } else {
                $_values[] = $this->getQuoted($value);
            }

            $columns[] = "`". $this->sanitize($key) ."`";
        }

        $this->_query[] = "(". implode(", ", $columns) .")";
        $this->_query[] = "VALUES";
        $this->_query[] = "(". implode(", ", $_values) .")";

        return $this;
    }
public function values ( array $ values ) : QueryBuilder { $ args = func_get_args ( ) ; $ columns = [ ] ; $ _values = [ ] ; foreach ( $ values as $ key => $ value ) { preg_match ( "/\(JSON\)\s*([\w]+)/i" , $ key , $ jsonTag ) ; if ( is_array ( $ value ) || is_object ( $ value ) ) { if ( isset ( $ jsonTag [ 0 ] ) ) { $ key = preg_replace ( '/\(JSON\)\s*([\w]+)/i' , '$1' , $ key ) ; $ _values [ ] = $ this -> getQuoted ( json_encode ( $ value ) ) ; } else { $ _values [ ] = $ this -> getQuoted ( serialize ( $ value ) ) ; } } else if ( is_bool ( $ value ) ) { $ _values [ ] = ( $ value ? 1 : 0 ) ; } else if ( is_null ( $ value ) ) { $ _values [ ] = "NULL" ; } else { $ _values [ ] = $ this -> getQuoted ( $ value ) ; } $ columns [ ] = "`" . $ this -> sanitize ( $ key ) . "`" ; } $ this -> _query [ ] = "(" . implode ( ", " , $ columns ) . ")" ; $ this -> _query [ ] = "VALUES" ; $ this -> _query [ ] = "(" . implode ( ", " , $ _values ) . ")" ; return $ this ; }
Begins the VALUES part of the query

@param array $values Values to insert

@return QueryBuilder Chainability object
Begins the VALUES part of the query