Completed
Push — develop ( d59f23...c634b7 )
by Sergei
139:07 queued 74:08
created

SchemaColumnDefinitionEventArgs::getDatabasePlatform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Event;
6
7
use Doctrine\DBAL\Connection;
8
use Doctrine\DBAL\Schema\Column;
9
10
/**
11
 * Event Arguments used when the portable column definition is generated inside Doctrine\DBAL\Schema\AbstractSchemaManager.
12
 */
13
class SchemaColumnDefinitionEventArgs extends SchemaEventArgs
14
{
15
    /** @var Column|null */
16
    private $column;
17
18
    /**
19
     * Raw column data as fetched from the database.
20
     *
21
     * @var array<string, mixed>
22
     */
23
    private $tableColumn;
24
25
    /** @var string */
26
    private $table;
27
28
    /** @var string */
29
    private $database;
30
31
    /** @var Connection */
32
    private $connection;
33
34
    /**
35
     * @param array<string, mixed> $tableColumn
36
     */
37
    public function __construct(array $tableColumn, string $table, string $database, Connection $connection)
38
    {
39
        $this->tableColumn = $tableColumn;
40 23
        $this->table       = $table;
41
        $this->database    = $database;
42 23
        $this->connection  = $connection;
43 23
    }
44 23
45 23
    /**
46 23
     * Allows to clear the column which means the column will be excluded from
47
     * tables column list.
48
     *
49
     * @return $this
50
     */
51
    public function setColumn(?Column $column) : self
52
    {
53
        $this->column = $column;
54
55
        return $this;
56
    }
57
58
    public function getColumn() : ?Column
59
    {
60
        return $this->column;
61
    }
62
63
    /**
64 23
     * @return array<string, mixed>
65
     */
66 23
    public function getTableColumn() : array
67
    {
68
        return $this->tableColumn;
69
    }
70
71
    public function getTable() : string
72
    {
73
        return $this->table;
74
    }
75
76
    public function getDatabase() : string
77
    {
78
        return $this->database;
79
    }
80
81
    public function getConnection() : Connection
82
    {
83
        return $this->connection;
84
    }
85
}
86