khepin / KhepinYamlFixturesBundle

Easy loading of fixtures defined in YAML files for Symfony2 and Doctrine2
MIT License
58 stars 42 forks source link

Posibility to add dynamic datime objects #25

Closed lenardpalko closed 11 years ago

lenardpalko commented 11 years ago

Often the objects in the database need to be up to date when the fixtures are loaded. Say we have a project in which we are doing some statistics based on last month activity. In a large project, that lasts more than 1 month at one time the fixtures will be outdated and the statistics won't show any relevant data and this means that the fixtures have to be updated every week. In order to avoid this it would be nice if in the fixtures we could have dynamic dates based on today: eg. -5 days, -10 days, -1 month

Do you think it's possible?

khepin commented 11 years ago

It's already possible. Try using "next month", "1 week ago" etc...

Anything that works with \DateTime will work here too.