2014-06-16 11:08 GMT+02:00 Jean-Rémy DUBOC <[email protected]>: > 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]. > 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. > -- 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.
