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

SchemaIndexDefinitionEventArgs::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\Index;
9
10
/**
11
 * Event Arguments used when the portable index definition is generated inside Doctrine\DBAL\Schema\AbstractSchemaManager.
12
 */
13
class SchemaIndexDefinitionEventArgs extends SchemaEventArgs
14
{
15
    /** @var Index|null */
16
    private $index;
17
18
    /**
19
     * Raw index data as fetched from the database.
20
     *
21
     * @var array<string, mixed>
22
     */
23
    private $tableIndex;
24
25
    /** @var string */
26
    private $table;
27
28
    /** @var Connection */
29
    private $connection;
30
31
    /**
32
     * @param array<string, mixed> $tableIndex
33
     */
34
    public function __construct(array $tableIndex, string $table, Connection $connection)
35
    {
36 23
        $this->tableIndex = $tableIndex;
37
        $this->table      = $table;
38 23
        $this->connection = $connection;
39 23
    }
40 23
41 23
    /**
42
     * Allows to clear the index which means the index will be excluded from tables index list.
43
     *
44
     * @return $this
45
     */
46
    public function setIndex(?Index $index) : self
47
    {
48
        $this->index = $index;
49
50
        return $this;
51
    }
52
53
    public function getIndex() : ?Index
54
    {
55
        return $this->index;
56
    }
57
58 23
    /**
59
     * @return array<string, mixed>
60 23
     */
61
    public function getTableIndex() : array
62
    {
63
        return $this->tableIndex;
64
    }
65
66
    public function getTable() : string
67
    {
68
        return $this->table;
69
    }
70
71
    public function getConnection() : Connection
72
    {
73
        return $this->connection;
74
    }
75
}
76