VersionAwarePlatformDriver.php 963 Bytes
Newer Older
1 2
<?php

Michael Moravec's avatar
Michael Moravec committed
3 4
declare(strict_types=1);

5 6
namespace Doctrine\DBAL;

7 8
use Doctrine\DBAL\Platforms\AbstractPlatform;

9 10 11 12 13 14 15 16
/**
 * Contract for a driver that is able to create platform instances by version.
 *
 * Doctrine uses different platform classes for different vendor versions to
 * support the correct features and SQL syntax of each version.
 * This interface should be implemented by drivers that are capable to do this
 * distinction.
 */
17
interface VersionAwarePlatformDriver extends Driver
18 19 20 21 22 23 24
{
    /**
     * Factory method for creating the appropriate platform instance for the given version.
     *
     * @param string $version The platform/server version string to evaluate. This should be given in the notation
     *                        the underlying database vendor uses.
     *
25
     * @throws DBALException If the given version string could not be evaluated.
26
     */
27
    public function createDatabasePlatformForVersion(string $version) : AbstractPlatform;
28
}