Skip to content

Commit c2d2cc5

Browse files
committed
improve
1 parent 2b46745 commit c2d2cc5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/QueryBuilder/AbstractColumnDefinitionBuilder.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,22 @@ protected function buildCheck(ColumnInterface $column): string
123123
{
124124
$check = $column->getCheck();
125125

126-
if ($column instanceof EnumColumn && $column->getDbType() === null) {
127-
$check = $column->getCheck();
126+
if (empty($check)
127+
&& $column instanceof EnumColumn
128+
&& $column->getDbType() === null
129+
) {
128130
$name = $column->getName();
129-
$items = $column->getValues();
130-
if (empty($check) && !empty($name)) {
131+
if (!empty($name)) {
131132
$quoter = $this->queryBuilder->getQuoter();
132-
$itemsList = implode(
133+
$quotedItems = implode(
133134
',',
134135
array_map(
135136
$quoter->quoteValue(...),
136-
$items,
137+
$column->getValues(),
137138
),
138139
);
139140
$quotedName = $quoter->quoteColumnName($name);
140-
$check = "$quotedName IN ($itemsList)";
141+
$check = "$quotedName IN ($quotedItems)";
141142
}
142143
}
143144

0 commit comments

Comments
 (0)