[Validator] Date validator converts DateTime object to string #6771

Closed
fkrauthan opened this Issue Jan 17, 2013 · 2 comments

Projects

None yet

2 participants

@fkrauthan

It looks like that the Date validator in sf 2.1.6 changes the content of a model. If i have something like this:

    /**
     * @ORM\Column(name="release_date", type="date")
     *
     * @Assert\Date()
     */
    protected $releaseDate;

The $releaseDate within my object has the type string after validation. If I remove @Assert\Date() the type of $releaseDate is a DateTime. So it looks like that the Date validator change the content and type of a Model and dose not only act as read only for validation.

@jakzal
Symfony member

@fkrauthan I can't reproduce it. Did you use the validator directly or with a form? If you've used a form what's the field type for $releaseDate in your form?

@fkrauthan

I was using $builder->add('releaseDate'); within my Form type. But I am not sure if that's still an issue. I am now with sf 2.3. I guess we can close that ticket and If I see something like that again I will create a new ticket.

@fkrauthan fkrauthan closed this Dec 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment