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

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

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

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

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

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

33
    /** @override */
34
    public function getBooleanTypeDeclarationSQL(array $field) {}
35

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

    /** @override */
40
    public function getBigIntTypeDeclarationSQL(array $field) {}
41 42

    /** @override */
43
    public function getSmallIntTypeDeclarationSQL(array $field) {}
44 45

    /** @override */
46
    protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) {}
47 48

    /** @override */
49
    public function getVarcharTypeDeclarationSQL(array $field) {}
50

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

romanb's avatar
romanb committed
54
    /* MOCK API */
55

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

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

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

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

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