SQLBuilder\Driver\MySQLDriver::deflate PHP Method

deflate() public method

public deflate ( $value, SQLBuilder\ArgumentArray $args = NULL )
$args SQLBuilder\ArgumentArray
    public function deflate($value, ArgumentArray $args = NULL)
    {
        if ($value instanceof DateTime) {
            // MySQL does not support date time string with timezone
            return $this->quote($value->format('Y-m-d H:i:s'));
        }
        return parent::deflate($value, $args);
    }

Usage Example

Exemplo n.º 1
0
 public function testAlwaysBindWithParamMarker()
 {
     $args = new ArgumentArray();
     $driver = new MySQLDriver();
     $driver->alwaysBindValues(true);
     $this->assertEquals('?', $driver->deflate(new ParamMarker('hack'), $args));
 }