[TYPO3-mvc] Compare two DB fields in repository query

Michael Grundkötter M.Grundkoetter at queo-flow.com
Thu Aug 4 15:16:51 CEST 2011


Hi.

Is it somehow possible to compare two db fields in the query api? I want something like:

$query = $this->createQuery();
$result = $query->matching($query->equals('tstamp', 'crdate'))->execute();

Which does not work of course as the operand (2nd param) is always considered to be a scalar value (a string in this case).
Right now, I use the getter of the result objects and compare the values afterwards which is not as good as comparing in the db (performance).

Any suggestions for that? Would be nice to have more comparison methods at the query class like equalsProperty($propA, $propB) or lessThanProperty etc. It could also be a Boolean flag in the existing methods to say the second value is NOT a scalar, but a property name as well.

Thanks for your help.

Michael


More information about the TYPO3-project-typo3v4mvc mailing list