Skip to content

Update Entities to use Doctrine 2.6 types #620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HeahDude opened this issue Jul 31, 2017 · 6 comments · Fixed by #669
Closed

Update Entities to use Doctrine 2.6 types #620

HeahDude opened this issue Jul 31, 2017 · 6 comments · Fixed by #669
Labels

Comments

@HeahDude
Copy link
Contributor

Thanks to symfony/symfony#22689 Comment and Post entities should now use the new date time_immutable type for their $publishedAt property, so getters/setters should accept DateTimeInterface.

If you agree, this should be an easy pick.

@javiereguiluz
Copy link
Member

It looks like a good idea! But let's not submit any pull request until #617 is merged. Thanks!

@voronkovich
Copy link
Contributor

Also we should replace the json_array type by json because the json_array is deprecated since Doctrine 2.6.

@javiereguiluz
Copy link
Member

This proposal is now unlocked and ready for someone who wants to contribute to this project with this easy pick. Thanks!

@gabel
Copy link

gabel commented Sep 25, 2017

I guess datetime_immutable can not be applied as the \App\Controller\Admin\BlogController::newAction uses handle($request) which transforms the input into a \DateTime object and that would break the ORM mapping. Looks like this is related to symfony/symfony#19889.

If you need more details I can provide a PR with example implementation.

@gabel
Copy link

gabel commented Sep 26, 2017

Talk is cheap.. PR is here #659 but test failing due to the mentioned issue.

javiereguiluz added a commit that referenced this issue Oct 9, 2017
This PR was merged into the master branch.

Discussion
----------

Use the new "json" type from DBAL 2.6

This partially fixes #620 and it's based on #659.

Commits
-------

189083f Use the new "json" type from DBAL 2.6
@javiereguiluz javiereguiluz reopened this Oct 9, 2017
@javiereguiluz
Copy link
Member

Let's close this as "fixed". The JSON types are now used and the immutable date can't be used because of Symfony Forms. The related issue (symfony/symfony#9508) has been opened for more than 4 years, so this is more difficult to implement than it looks. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants