[TYPO3-mvc] QueryResult object has issues with offsets and "count" method ?
Franz Koch
typo3.RemoveForMessage at elements-net.de
Fri Nov 19 11:24:18 CET 2010
Hey Bastian,
sorry for late response - I got to bed way tooo late and didn't get out
this morning :(
To answer your other posting - no, I don't use DBAL - it's a regular
MySQL installation.
>> [...]I just noticed a issue with the QueryResult object in
>> combination with it's count method. In combination with a defined offset
>> by the repository, count will return NULL/FALSE.
>
> I can't reproduce the result NULL/FALSE.. But I had a look at it and
> there is indeed a logical issue with the QueryResult:
>
> If you call count() on a QueryResult that has been initialized already
> (by iterating through the result or calling the toArray() method) a
> regular count() is executed on the array that contains the fetched objects.
> If the Result has not been touched yet, count will actually execute a
> COUNT(*) Query. That's nice, because you can count all objects before
> retrieving only a subset from the Database.
> The problem is: Count queries ignore the LIMIT constraint.
That should at least lead to a result - but I don't get any with the
count query.
> I'll have to check how we can fix this in a backwards compatible way..
By speaking of backwards compatibility - I notice that the getObject
method was dropped from the objectManager - too bad for users that
already used it to be better upwards compatible.
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list