Skip to content

Commit

Permalink
feature #24297 Feature/doctrine type guesser simple json array suppor…
Browse files Browse the repository at this point in the history
…t (iluuu1994)

This PR was squashed before being merged into the 4.2-dev branch (closes #24297).

Discussion
----------

Feature/doctrine type guesser simple json array support

Symfony currently supports doctrine/dbal ~2.4 which has support for both `simple_array` and `json_array`:

doctrine/dbal@44cd77f
doctrine/dbal@2d183ac

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

There's technically a small BC break since `simple_array` and `json_array` fields would've been displayed as simple text fields. Is this an acceptable BC break for Symfony 3.4?

Commits
-------

524bc4b Feature/doctrine type guesser simple json array support
  • Loading branch information
fabpot committed Sep 4, 2018
2 parents 8f5229f + 524bc4b commit 2ea27cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Symfony/Bridge/Doctrine/CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@ CHANGELOG

* deprecated injecting `ClassMetadataFactory` in `DoctrineExtractor`,
an instance of `EntityManagerInterface` should be injected instead
* added support for `simple_array` type

4.1.0
-----
Expand Down
Expand Up @@ -53,6 +53,7 @@ public function guessType($class, $property)

switch ($metadata->getTypeOfField($property)) {
case Type::TARRAY:
case Type::SIMPLE_ARRAY:
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CollectionType', array(), Guess::MEDIUM_CONFIDENCE);
case Type::BOOLEAN:
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CheckboxType', array(), Guess::HIGH_CONFIDENCE);
Expand Down

0 comments on commit 2ea27cd

Please sign in to comment.