Closed UtechtDustin closed 5 years ago
Oh okay i figured out its null because i use no
->add('deactivated', DateTimeColumn::class)
But i f i i use it the null Value is a Datetime Object with the Date -001-11-30T00:00:00+01:00
, also with the nullValue
Option.
I'm pretty sure you're seeing a different problem. The nullValue
transformation is explicitly tested at https://github.com/omines/datatables-bundle/blob/master/tests/Unit/ColumnTest.php#L39 so I'm very sure that is working correctly.
What I think is that the Symfony property accessor is 'seeing' your isDeactivated
method first and using it instead of getDeactivated
. This would mean you're transforming false
instead of null
, which explains the date in 1BC. You should be able to solve this by explicitly binding to getDeactivated
instead, or for example refactoring it to getDeactivationDate
(will also help avoid issues in Twig).
@curry684 Im not sure why... but it works now with the same code... Maybe a doctrine caching issue ?
That could also be possible 😄 glad to hear it's solved!
My Entity:
The datatable (php) Part:
I tried to show different buttons if the customer is (de)actived, but i always saw the deactived button so i used
{{ dump(row) }}
in the twig template and got the following outputBut the Customer has a date in the database! Also if i fetch the User in Symfony the deativated attribute of the customer is filled!
Edit: Another quick question... is it possible to automaticlly translate the labels ?