1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Setup\Declaration\Schema\Dto;
/**
* Column structural element.
*/
class Column extends GenericElement implements
ElementInterface,
TableElementInterface
{
/**
* Element type.
*/
const TYPE = 'column';
/**
* @var Table
*/
private $table;
/**
* @var null|string
*/
private $onCreate;
/**
* @var string
*/
private $comment;
/**
* Constructor.
*
* @param string $name
* @param string $type
* @param Table $table
* @param string $comment
* @param string|null $onCreate
*/
public function __construct(
string $name,
string $type,
Table $table,
string $comment = null,
string $onCreate = null
) {
parent::__construct($name, $type);
$this->table = $table;
$this->onCreate = $onCreate;
$this->comment = $comment;
}
/**
* Retrieve table name.
*
* @return Table
*/
public function getTable()
{
return $this->table;
}
/**
* @inheritdoc
*/
public function getElementType()
{
return self::TYPE;
}
/**
* Get On Create statement.
*
* @return null|string
*/
public function getOnCreate()
{
return $this->onCreate;
}
/**
* {@inheritdoc}
*/
public function getComment()
{
return $this->comment;
}
}