public function quote($value)
    {
        switch (true) {
            case $value === null:
                return 'null';

            case $value === true:
                return '1';

            case $value === false:
                return '0';

            case $value instanceof Expr:
                return $value->getValue();

            case is_int($value) || ctype_digit($value):
                return (int) $value;

            case is_float($value):
                // Convert to non-locale aware float to prevent possible commas
                return sprintf('%F', $value);

            case is_array($value):
                // Supports MVA attributes
                if (!count($value)) {
                    return '()';
                }

                return '('.implode(',', $this->quoteArr($value)).')';
        }

        return $this->conn->quote($value);
    }
public function quote($value)
    {
        switch (true) {
            case $value === null:
                return 'null';

            case $value === true:
                return '1';

            case $value === false:
                return '0';

            case $value instanceof Expr:
                return $value->getValue();

            case is_int($value) || ctype_digit($value):
                return (int) $value;

            case is_float($value):
                // Convert to non-locale aware float to prevent possible commas
                return sprintf('%F', $value);

            case is_array($value):
                // Supports MVA attributes
                if (!count($value)) {
                    return '()';
                }

                return '('.implode(',', $this->quoteArr($value)).')';
        }

        return $this->conn->quote($value);
    }
public function quote ( $ value ) { switch ( true ) { case $ value === null : return 'null' ; case $ value === true : return '1' ; case $ value === false : return '0' ; case $ value instanceof Expr : return $ value -> getValue ( ) ; case is_int ( $ value ) || ctype_digit ( $ value ) : return ( int ) $ value ; case is_float ( $ value ) : // Convert to non-locale aware float to prevent possible commas return sprintf ( '%F' , $ value ) ; case is_array ( $ value ) : // Supports MVA attributes if ( ! count ( $ value ) ) { return '()' ; } return '(' . implode ( ',' , $ this -> quoteArr ( $ value ) ) . ')' ; } return $ this -> conn -> quote ( $ value ) ; }
Adds quotes around values when necessary.
Based on FuelPHP's quoting function.

@param Expr|mixed $value The input string, eventually wrapped in an expression to leave it untouched

@return string The untouched Expression or the quoted string
Adds quotes around values when necessary . Based on FuelPHP s quoting function .