1- When using the Doctrine plugin for symfony, and the versionable behavior,
the version classes don't seem to be generated like specified in the
Doctrine documentation. However the version classes for the forms are
generated. Is there a way to generate the model classes too?

2- Now more importantly, I want, through the version table, to get a
snapshot of what the main table was at a given time T. So I'm trying to
select only records that satisfy "updated_at" < T, but among those records I
might have multiple versions of the same record and I only want the one that
was the most up to date at time T. In SQL I can make a subquery on the same
table to get the maximum "updated_at" value before T or the maximum version
number with "updated_at" < T.

The same request in DQL does not seem to work. If I try:

$q = Doctrine_Core::getTable('ObjectVersion')->createQuery('fv1')
            ->where('fv1.updated_at = (select max(fv2.updated_at) from
ObjectVersion fv2 where fv1.id = fv2.id and fv2.updated_at < ?)','2010-12-29
06:40:59');

I get an exception "Couldn't find class fv2".

However if I output the DQL from the query, what I get corresponds perfectly
to the SQL I could use directly in the DB...

Any ideas are welcome!

Thanks,
Khepin

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to