protected function formatValues($field, $value) {
        if(!is_array($value) && Operators::isOperatorValid($value) && !Operators::isOperatorPrepared($value)) {
            return sprintf("`%s` %s", SafeString::makeSafe($field), Operators::getOperatorFormat($value));
        }
        elseif(is_array($value)) {
            $keys = [];
            if(!is_array(array_values($value)[0])) {
                $this->values[] = (isset($value[1]) ? $value[1] : array_values($value)[0]);
                $operator = (isset($value[0]) ? $value[0] : key($value));
            }
            else{
                foreach(array_values($value)[0] as $op => $array_value) {
                    $this->values[] = $array_value;
                    $keys[] = '?';
                }
                $operator = key($value);
            }
            return sprintf("`%s` %s", SafeString::makeSafe($field), sprintf(Operators::getOperatorFormat($operator), implode($keys, ', ')));
            
        }
        $this->values[] = $value;
        return sprintf("`%s` = ?", SafeString::makeSafe($field));
    }
protected function formatValues($field, $value) {
        if(!is_array($value) && Operators::isOperatorValid($value) && !Operators::isOperatorPrepared($value)) {
            return sprintf("`%s` %s", SafeString::makeSafe($field), Operators::getOperatorFormat($value));
        }
        elseif(is_array($value)) {
            $keys = [];
            if(!is_array(array_values($value)[0])) {
                $this->values[] = (isset($value[1]) ? $value[1] : array_values($value)[0]);
                $operator = (isset($value[0]) ? $value[0] : key($value));
            }
            else{
                foreach(array_values($value)[0] as $op => $array_value) {
                    $this->values[] = $array_value;
                    $keys[] = '?';
                }
                $operator = key($value);
            }
            return sprintf("`%s` %s", SafeString::makeSafe($field), sprintf(Operators::getOperatorFormat($operator), implode($keys, ', ')));
            
        }
        $this->values[] = $value;
        return sprintf("`%s` = ?", SafeString::makeSafe($field));
    }
protected function formatValues ( $ field , $ value ) { if ( ! is_array ( $ value ) && Operators :: isOperatorValid ( $ value ) && ! Operators :: isOperatorPrepared ( $ value ) ) { return sprintf ( "`%s` %s" , SafeString :: makeSafe ( $ field ) , Operators :: getOperatorFormat ( $ value ) ) ; } elseif ( is_array ( $ value ) ) { $ keys = [ ] ; if ( ! is_array ( array_values ( $ value ) [ 0 ] ) ) { $ this -> values [ ] = ( isset ( $ value [ 1 ] ) ? $ value [ 1 ] : array_values ( $ value ) [ 0 ] ) ; $ operator = ( isset ( $ value [ 0 ] ) ? $ value [ 0 ] : key ( $ value ) ) ; } else { foreach ( array_values ( $ value ) [ 0 ] as $ op => $ array_value ) { $ this -> values [ ] = $ array_value ; $ keys [ ] = '?' ; } $ operator = key ( $ value ) ; } return sprintf ( "`%s` %s" , SafeString :: makeSafe ( $ field ) , sprintf ( Operators :: getOperatorFormat ( $ operator ) , implode ( $ keys , ', ' ) ) ) ; } $ this -> values [ ] = $ value ; return sprintf ( "`%s` = ?" , SafeString :: makeSafe ( $ field ) ) ; }
Format the where queries and set the prepared values
@param string $field This should be the field name in the database
@param mixed $value This should be the value which should either be a string or an array if it contains an operator
@return string This should be the string to add to the SQL query
Format the where queries and set the prepared values