DatabasePlatformMock.php 2.02 KB
Newer Older
1 2
<?php

3
namespace Doctrine\Tests\Mocks;
romanb's avatar
romanb committed
4

jeroendedauw's avatar
jeroendedauw committed
5 6
use Doctrine\DBAL\DBALException;

7
class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
8
{
9
    private $_sequenceNextValSql = "";
10 11
    private $_prefersIdentityColumns = true;
    private $_prefersSequences = false;
12

romanb's avatar
romanb committed
13 14 15
    /**
     * @override
     */
16 17
    public function prefersIdentityColumns()
    {
romanb's avatar
romanb committed
18 19
        return $this->_prefersIdentityColumns;
    }
20

21 22 23 24 25 26 27 28
    /**
     * @override
     */
    public function prefersSequences()
    {
        return $this->_prefersSequences;
    }

29
    /** @override */
30
    public function getSequenceNextValSQL($sequenceName)
31 32 33 34
    {
        return $this->_sequenceNextValSql;
    }

35
    /** @override */
36
    public function getBooleanTypeDeclarationSQL(array $field) {}
37

38
    /** @override */
39
    public function getIntegerTypeDeclarationSQL(array $field) {}
40 41

    /** @override */
42
    public function getBigIntTypeDeclarationSQL(array $field) {}
43 44

    /** @override */
45
    public function getSmallIntTypeDeclarationSQL(array $field) {}
46 47

    /** @override */
48
    protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) {}
49 50

    /** @override */
51
    public function getVarcharTypeDeclarationSQL(array $field) {}
52

53
    /** @override */
54
    public function getClobTypeDeclarationSQL(array $field) {}
55

romanb's avatar
romanb committed
56
    /* MOCK API */
57

romanb's avatar
romanb committed
58 59
    public function setPrefersIdentityColumns($bool)
    {
60 61 62 63 64 65
        $this->_prefersIdentityColumns = $bool;
    }

    public function setPrefersSequences($bool)
    {
        $this->_prefersSequences = $bool;
romanb's avatar
romanb committed
66
    }
67 68 69 70 71

    public function setSequenceNextValSql($sql)
    {
        $this->_sequenceNextValSql = $sql;
    }
72 73 74 75 76

    public function getName()
    {
        return 'mock';
    }
77 78
    protected function initializeDoctrineTypeMappings() {
    }
79 80
    protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed)
    {
81 82 83 84 85 86 87 88

    }
    /**
     * Gets the SQL Snippet used to declare a BLOB column type.
     */
    public function getBlobTypeDeclarationSQL(array $field)
    {
        throw DBALException::notSupported(__METHOD__);
89
    }
90
}