Statement.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Doctrine\DBAL\Driver\PDOSqlsrv;
  3. use Doctrine\DBAL\Driver\PDO;
  4. use Doctrine\DBAL\ParameterType;
  5. /**
  6. * PDO SQL Server Statement
  7. *
  8. * @deprecated Use {@link PDO\SQLSrv\Statement} instead.
  9. */
  10. class Statement extends PDO\Statement
  11. {
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null)
  16. {
  17. switch ($type) {
  18. case ParameterType::LARGE_OBJECT:
  19. case ParameterType::BINARY:
  20. if ($driverOptions === null) {
  21. $driverOptions = \PDO::SQLSRV_ENCODING_BINARY;
  22. }
  23. break;
  24. case ParameterType::ASCII:
  25. $type = ParameterType::STRING;
  26. $length = 0;
  27. $driverOptions = \PDO::SQLSRV_ENCODING_SYSTEM;
  28. break;
  29. }
  30. return parent::bindParam($param, $variable, $type, $length, $driverOptions);
  31. }
  32. /**
  33. * {@inheritdoc}
  34. */
  35. public function bindValue($param, $value, $type = ParameterType::STRING)
  36. {
  37. return $this->bindParam($param, $value, $type);
  38. }
  39. }