added support for propel enum types in PropelTypeGuesser
This commit is contained in:
parent
8c320b0dfd
commit
3ae5b55882
@ -79,7 +79,14 @@ class PropelTypeGuesser implements FormTypeGuesserInterface
|
||||
case \PropelColumnTypes::BIGINT:
|
||||
case \PropelColumnTypes::NUMERIC:
|
||||
return new TypeGuess('integer', array(), Guess::MEDIUM_CONFIDENCE);
|
||||
case \PropelColumnTypes::ENUM:
|
||||
case \PropelColumnTypes::CHAR:
|
||||
if ($column->getValueSet()) {
|
||||
//check if this is mysql enum
|
||||
$choices = $column->getValueSet();
|
||||
$labels = array_map('ucfirst', $choices);
|
||||
return new TypeGuess('choice', array('choices' => array_combine($choices, $labels)), Guess::MEDIUM_CONFIDENCE);
|
||||
}
|
||||
case \PropelColumnTypes::VARCHAR:
|
||||
return new TypeGuess('text', array(), Guess::MEDIUM_CONFIDENCE);
|
||||
case \PropelColumnTypes::LONGVARCHAR:
|
||||
|
Reference in New Issue
Block a user