| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Doctrine\DBAL\Driver;
|
|
|
4 |
|
|
|
5 |
use Doctrine\DBAL\Connection;
|
|
|
6 |
use Doctrine\DBAL\Driver;
|
|
|
7 |
use Doctrine\DBAL\Driver\API\ExceptionConverter as ExceptionConverterInterface;
|
|
|
8 |
use Doctrine\DBAL\Driver\API\SQLSrv\ExceptionConverter;
|
|
|
9 |
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
|
|
10 |
use Doctrine\DBAL\Platforms\SQLServer2012Platform;
|
|
|
11 |
use Doctrine\DBAL\Platforms\SQLServerPlatform;
|
|
|
12 |
use Doctrine\DBAL\Schema\SQLServerSchemaManager;
|
|
|
13 |
use Doctrine\Deprecations\Deprecation;
|
|
|
14 |
|
|
|
15 |
use function assert;
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* Abstract base implementation of the {@see Driver} interface for Microsoft SQL Server based drivers.
|
|
|
19 |
*/
|
|
|
20 |
abstract class AbstractSQLServerDriver implements Driver
|
|
|
21 |
{
|
|
|
22 |
/**
|
|
|
23 |
* {@inheritdoc}
|
|
|
24 |
*/
|
|
|
25 |
public function getDatabasePlatform()
|
|
|
26 |
{
|
|
|
27 |
return new SQLServer2012Platform();
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
/**
|
|
|
31 |
* {@inheritdoc}
|
|
|
32 |
*
|
|
|
33 |
* @deprecated Use {@link SQLServerPlatform::createSchemaManager()} instead.
|
|
|
34 |
*/
|
|
|
35 |
public function getSchemaManager(Connection $conn, AbstractPlatform $platform)
|
|
|
36 |
{
|
|
|
37 |
Deprecation::triggerIfCalledFromOutside(
|
|
|
38 |
'doctrine/dbal',
|
|
|
39 |
'https://github.com/doctrine/dbal/pull/5458',
|
|
|
40 |
'AbstractSQLServerDriver::getSchemaManager() is deprecated.'
|
|
|
41 |
. ' Use SQLServerPlatform::createSchemaManager() instead.',
|
|
|
42 |
);
|
|
|
43 |
|
|
|
44 |
assert($platform instanceof SQLServerPlatform);
|
|
|
45 |
|
|
|
46 |
return new SQLServerSchemaManager($conn, $platform);
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
public function getExceptionConverter(): ExceptionConverterInterface
|
|
|
50 |
{
|
|
|
51 |
return new ExceptionConverter();
|
|
|
52 |
}
|
|
|
53 |
}
|