Thank you very much for your answer; this confirm my suspicions. The 
problem is that the MySQL time type can be used for both a fixed point in 
time or for time intervals.
I imagine it could make sense to create a mapping from SQL time type to PHP 
DateInterval, but your idea of using a string instead might work too.


On Monday, 16 June 2014 11:09:21 UTC+1, Sebastian Krebs wrote:
>
>
>
>
> 2014-06-16 11:08 GMT+02:00 Jean-Rémy DUBOC <[email protected] 
> <javascript:>>:
>
>> Hi all,
>> I'm new to Doctrine and the community, so I apologize if this topic has 
>> been debated and settled before.
>>
>> I'm trying to map an SQL time variable, but the durations I use are 
>> longer than 24 hours, and as a consequence the mapping to a PHP DateTime 
>> object doesn't work. What are my options here ? Use an integer SQL variable 
>> instead (see this thread on stackoverflow 
>> <http://stackoverflow.com/questions/13205945/doctrine-2-how-to-enter-a-length-greater-than-24-hours-into-a-time-field>)?
>>  
>> Change the way the mapping is done manually (seems like overkill).
>> It feels like Doctrine users would benefit from different way to map SQL 
>> time object when they are using them for time intervals...any thoughts?
>>
>> Thanks in advance,
>>
>
> It sounds you are actually trying to handle intervals and not dates, or 
> times, don't you? Because datetimes (in any form) cannot have more than 24h 
> on this planet, because they represent a moment in time, where an hour 
> "42"simply doesn't exists. But intervals as a timespan can be represented 
> as 48h as synonym of 2d.
> As far as I know there is no native SQL-type, but I can imagine it would 
> be already useful to have a doctrine mapping from DateInterval to string 
> (format like in your case 'PT96H', see 
> http://php.net/dateinterval.construct ).
>  
>
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "doctrine-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/doctrine-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> github.com/KingCrunch 
>  

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to