File tree 1 file changed +8
-5
lines changed
src/Repositories/Entities/MariaDB
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class CheckConstraint
26
26
/** @var string */
27
27
private $ constraintName ;
28
28
29
- /** @var string */
29
+ /** @var string|null */
30
30
private $ level ;
31
31
32
32
/** @var string */
@@ -44,8 +44,11 @@ public function __construct(stdClass $column)
44
44
$ this ->constraintSchema = $ lowerKey ['constraint_schema ' ];
45
45
$ this ->tableName = $ lowerKey ['table_name ' ];
46
46
$ this ->constraintName = $ lowerKey ['constraint_name ' ];
47
- $ this ->level = $ lowerKey ['level ' ];
48
- $ this ->checkClause = $ lowerKey ['check_clause ' ];
47
+ $ this ->level = null ;
48
+ if (isset ($ lowerKey ['level ' ])) {
49
+ $ this ->level = $ lowerKey ['level ' ];
50
+ }
51
+ $ this ->checkClause = $ lowerKey ['check_clause ' ];
49
52
}
50
53
51
54
/**
@@ -91,9 +94,9 @@ public function getConstraintName(): string
91
94
/**
92
95
* Type of the constraint ('Column' or 'Table'). From MariaDB 10.5.10
93
96
*
94
- * @return string
97
+ * @return string|null NULL if MariaDB < 10.5.10
95
98
*/
96
- public function getLevel (): string
99
+ public function getLevel (): ? string
97
100
{
98
101
return $ this ->level ;
99
102
}
You can’t perform that action at this time.
0 commit comments