Repository navigation
Expand file tree
/
Copy pathConstraintKeyObject.php
More file actions
173 lines (142 loc) · 3.74 KB
/
Copy pathConstraintKeyObject.php
File metadata and controls
173 lines (142 loc) · 3.74 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
declare(strict_types=1);
namespace PhpDb\Metadata\Object;
class ConstraintKeyObject
{
final public const FK_CASCADE = 'CASCADE';
final public const FK_SET_NULL = 'SET NULL';
final public const FK_NO_ACTION = 'NO ACTION';
final public const FK_RESTRICT = 'RESTRICT';
final public const FK_SET_DEFAULT = 'SET DEFAULT';
protected ?int $ordinalPosition = null;
protected ?bool $positionInUniqueConstraint = null;
protected ?string $referencedTableSchema = null;
protected ?string $referencedTableName = null;
protected ?string $referencedColumnName = null;
protected ?string $foreignKeyUpdateRule = null;
protected ?string $foreignKeyDeleteRule = null;
/**
* Constructor
*/
public function __construct(
protected string $columnName,
) {}
/**
* Get column name
*/
public function getColumnName(): string
{
return $this->columnName;
}
/**
* get foreign key delete rule
*/
public function getForeignKeyDeleteRule(): ?string
{
return $this->foreignKeyDeleteRule;
}
/**
* Get foreign key update rule
*/
public function getForeignKeyUpdateRule(): ?string
{
return $this->foreignKeyUpdateRule;
}
/**
* Get ordinal position
*/
public function getOrdinalPosition(): ?int
{
return $this->ordinalPosition;
}
/**
* Get position in unique constraint
*/
public function getPositionInUniqueConstraint(): ?bool
{
return $this->positionInUniqueConstraint;
}
/**
* Get referenced column name
*/
public function getReferencedColumnName(): ?string
{
return $this->referencedColumnName;
}
/**
* Get referenced table name
*/
public function getReferencedTableName(): ?string
{
return $this->referencedTableName;
}
/**
* Get referenced table schema
*/
public function getReferencedTableSchema(): ?string
{
return $this->referencedTableSchema;
}
/**
* Set column name
*/
public function setColumnName(string $columnName): static
{
$this->columnName = $columnName;
return $this;
}
/**
* Set foreign key delete rule
*/
public function setForeignKeyDeleteRule(string $foreignKeyDeleteRule): void
{
$this->foreignKeyDeleteRule = $foreignKeyDeleteRule;
}
/**
* set foreign key update rule
*/
public function setForeignKeyUpdateRule(string $foreignKeyUpdateRule): void
{
$this->foreignKeyUpdateRule = $foreignKeyUpdateRule;
}
/**
* Set ordinal position
*/
public function setOrdinalPosition(int $ordinalPosition): static
{
$this->ordinalPosition = $ordinalPosition;
return $this;
}
/**
* Set position in unique constraint
*/
public function setPositionInUniqueConstraint(bool $positionInUniqueConstraint): static
{
$this->positionInUniqueConstraint = $positionInUniqueConstraint;
return $this;
}
/**
* Set referenced column name
*/
public function setReferencedColumnName(string $referencedColumnName): static
{
$this->referencedColumnName = $referencedColumnName;
return $this;
}
/**
* Set Referenced table name
*/
public function setReferencedTableName(string $referencedTableName): static
{
$this->referencedTableName = $referencedTableName;
return $this;
}
/**
* Set referenced table schema
*/
public function setReferencedTableSchema(string $referencedTableSchema): static
{
$this->referencedTableSchema = $referencedTableSchema;
return $this;
}
}