20 if ($constraintName ===
false)
24 elseif (!$constraintName)
26 $constraintName = $tokenizer->getCurrentToken()->text;
27 $tokenizer->nextToken();
28 $tokenizer->skipWhiteSpace();
31 $constraint =
new self($constraintName);
33 $token = $tokenizer->getCurrentToken();
34 $level = $token->level;
36 $constraintDefinition =
'';
39 if ($token->text ===
'(' && $token->level == $level)
45 || ($token->text ===
')' && $token->level == $level)
48 $column = trim($column);
51 $constraint->columns[] = trim($column);
57 $column .= $token->text;
60 if ($token->level == $level && $token->text ===
',')
64 if ($token->level < $level && $token->text ===
')')
69 $constraintDefinition .= $token->text;
71 $token = $tokenizer->nextToken();
75 $constraint->setBody($constraintDefinition);