[TYPO3-extbase-kickstarter] Partials missing

Jost Baron Jost.Baron at gmx.de
Mon Mar 12 12:49:07 CET 2012


Hi again,

I've now looked into this. In the end, the problem seems to be that
there are no "natural" PHP types for time, timesec, date and so on. So
you can't simply use a property

/**
 * @var Date
 */
protected $foo;

To get around this, I propose to simply use DateTime as the type for
date, time and timesec in the domain model. This would make changes to
extbase unnecessary and would be simple to implement (some changes in
the templates, as far as i can see).

The drawback is, that there is always a complete DateTime object used in
the generated model objects. If, for example, only the time is given by
user input, it would be completed to a complete date, using the current
date. This could lead to problems, for example when comparing two times.

As this is only a kickstarter, so if someone needs more sophisticated
time, date or timesec types, he has to write them himself.

Regards,
Jost

On Wed, 2012-03-07 at 14:35 +0100, Nicolas de Haen wrote:
> Hi Jost,
> 
> have a look at the thawProperties method in 
> Classes/Persistence/Mapper/DataMapper.php there you find a list of 
> currently supported property types and the mapDateTime method as an 
> example how to map a property value to a property
> 
> http://forge.typo3.org/projects/typo3v4-mvc/repository/revisions/master/entry/Classes/Persistence/Mapper/DataMapper.php
> 
> 
> It should not be too difficult, but you have to consider that there is a 
> new property mapper since 1.4. There you can add TypeConverter for 
> custom property types.
> 
> http://forge.typo3.org/projects/typo3v4-mvc/repository/revisions/master/entry/Classes/Property/PropertyMapper.php
> 
> If you write a patch for that the chances are good to get them into the 
> code I guess...
> 
> regards,
> Nico
> 
> 



More information about the TYPO3-project-extbase-kickstarter mailing list