Statement.php 868 Bytes
Newer Older
1 2 3 4 5
<?php

namespace Doctrine\DBAL\Driver\PDOSqlsrv;

use Doctrine\DBAL\Driver\PDOStatement;
6
use Doctrine\DBAL\ParameterType;
7 8 9 10 11 12 13 14 15 16
use PDO;

/**
 * PDO SQL Server Statement
 */
class Statement extends PDOStatement
{
    /**
     * {@inheritdoc}
     */
17
    public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null)
18
    {
19 20
        if (
            ($type === ParameterType::LARGE_OBJECT || $type === ParameterType::BINARY)
21 22
            && $driverOptions === null
        ) {
23 24 25 26 27 28 29 30 31
            $driverOptions = PDO::SQLSRV_ENCODING_BINARY;
        }

        return parent::bindParam($column, $variable, $type, $length, $driverOptions);
    }

    /**
     * {@inheritdoc}
     */
32
    public function bindValue($param, $value, $type = ParameterType::STRING)
33 34 35 36
    {
        return $this->bindParam($param, $value, $type);
    }
}