|
@@ 21-26 (lines=6) @@
|
| 18 |
|
*/ |
| 19 |
|
public function guessType($class, $property) |
| 20 |
|
{ |
| 21 |
|
if (!$ret = $this->getMetadata($class)) { |
| 22 |
|
$type = method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix') |
| 23 |
|
? 'Symfony\Component\Form\Extension\Core\Type\TextType' |
| 24 |
|
: 'text'; |
| 25 |
|
return new TypeGuess($type, [], Guess::LOW_CONFIDENCE); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
$metadata = $ret[0]; |
| 29 |
|
|
|
@@ 30-35 (lines=6) @@
|
| 27 |
|
|
| 28 |
|
$metadata = $ret[0]; |
| 29 |
|
|
| 30 |
|
if ('simple_array' == $metadata->getTypeOfField($property)) { |
| 31 |
|
$type = method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix') |
| 32 |
|
? 'EmanueleMinotto\SimpleArrayBundle\Form\Type\SimpleArrayType' |
| 33 |
|
: 'simple_array'; |
| 34 |
|
return new TypeGuess($type, [], Guess::MEDIUM_CONFIDENCE); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
return parent::guessType($class, $property); |
| 38 |
|
} |