[TYPO3-mvc] Working with limit and offsets, missing exception?
Marc Bastian Heinrichs
typo3 at mbh-web.de
Tue Nov 23 17:14:55 CET 2010
Hi Georg,
> I came across a problem and wondering if there is an exception missing
> in parseLimitAndOffset() inside Typo3DbBackend.
>
> Example:
> - Using $query->setLimit() without an offset works fine, no problem
> - Using $query->setLimit() && $query->setOffset works fine too.
>
> Using $query->setOffset without $query->setLimit() can't work as the DB
> query needs both values. Query: ... LIMIT 4,10 => offset of 4, but LIMIT
> 4 gives you 4 records.
Without changing the api, I think it would be better to point the user
to his mistake using offset without limit by an exception, rather than
ignoring it.
But from using the api, I think, it would be much better to deprecate
setOffset and having an second optional parameter in setLimit for
setting the offset.
Regards,
Marc Bastian
More information about the TYPO3-project-typo3v4mvc
mailing list