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

namespace Doctrine\DBAL\Driver\PDOSqlsrv;

5
use Doctrine\DBAL\Driver\PDO\Statement as BaseStatement;
6
use Doctrine\DBAL\ParameterType;
7 8 9 10 11
use PDO;

/**
 * PDO SQL Server Statement
 */
12
class Statement extends BaseStatement
13 14 15 16
{
    /**
     * {@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);
    }
}