Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

transform() function return null for type filter_datetime_range #66

Closed
imadtouil opened this issue Aug 1, 2013 · 3 comments
Closed

Comments

@imadtouil
Copy link

In my FilterType Classe i have :

$builder->add('created_at', 'filter_datetime_range', array(
            'left_datetime' => array(
                'date_widget' => 'single_text', 
                'time_widget' => 'single_text'
            ),
            'right_datetime' => array(),
        ));      

While debugging the where clause for datetime not show up on the Query.

when i debug the bundle i found on the FilterValueKeysTransformer class line 21

$data = $form->getData();

the $data is empty with (null value).

Otherwise, on the same $form i found the data as ExtratData

You can access to it with

$form->getParent()->getExtraData()

i am not sure if i did something wrong while using this format, let me know what do you think!!

@cedric-g
Copy link
Collaborator

cedric-g commented Aug 2, 2013

Hi, hum I don't think you did something wrong, I'll try to do more tests with the filter_datetime_range to check if I get the same kind of error.

@imadtouil
Copy link
Author

I think something's wrong with the date Type,

because i was trying also filter_date type and i got the same result (null).

$builder->add('created_at', 'filter_date');

I am going to check, what i can find too.

@raphox
Copy link
Contributor

raphox commented Nov 18, 2014

1+

Updated:
I was using version 2.1.2 and sample code from version 3. I think there are some differences.
Now I'm using version 3.0.1 and everything looks fine.

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

No branches or pull requests

3 participants