DatabasePlatformMock.php 2.17 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
    public function getNativeDeclaration(array $field) {}
15

romanb's avatar
romanb committed
16 17 18
    /**
     * @override
     */
19
    public function getPortableDeclaration(array $field) {}
20

romanb's avatar
romanb committed
21 22 23
    /**
     * @override
     */
24 25
    public function prefersIdentityColumns()
    {
romanb's avatar
romanb committed
26 27
        return $this->_prefersIdentityColumns;
    }
28

29 30 31 32 33 34 35 36
    /**
     * @override
     */
    public function prefersSequences()
    {
        return $this->_prefersSequences;
    }

37
    /** @override */
38
    public function getSequenceNextValSQL($sequenceName)
39 40 41 42
    {
        return $this->_sequenceNextValSql;
    }

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

46
    /** @override */
47
    public function getIntegerTypeDeclarationSQL(array $field) {}
48 49

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

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

    /** @override */
56
    protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) {}
57 58

    /** @override */
59
    public function getVarcharTypeDeclarationSQL(array $field) {}
60

61
    /** @override */
62
    public function getClobTypeDeclarationSQL(array $field) {}
63

romanb's avatar
romanb committed
64
    /* MOCK API */
65

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

    public function setPrefersSequences($bool)
    {
        $this->_prefersSequences = $bool;
romanb's avatar
romanb committed
74
    }
75 76 77 78 79

    public function setSequenceNextValSql($sql)
    {
        $this->_sequenceNextValSql = $sql;
    }
80 81 82 83 84

    public function getName()
    {
        return 'mock';
    }
85 86
    protected function initializeDoctrineTypeMappings() {
    }
87 88
    protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed)
    {
89 90 91 92 93 94 95 96

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