Ticket #784 (closed Bug: worksforme)
limit() no longer works correctly through ORM
| Reported by: | Drarok | Owned by: | Shadowhand |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Libraries:ORM | Version: | SVN HEAD |
| Keywords: | orm limit | Cc: |
Description
The following code: `$filedb = new File_Model; // This is an ORM subclass. $files = $filedb->orderby('created', 'desc')->limit(15, 30)->find_all();`
Results in the incorrect query: SELECT files.* FROM files ORDER BY created DESC LIMIT 0, 15
Using ->limit()->find() also doesn't work correctly. I've been shown the new way is to use ->find_all($limit, $offset), but if this is the case, the documentation needs updating, and ->limit needs to fail.
The above method used to work (this was presumably before ORM2).
Change History
Note: See
TracTickets for help on using
tickets.
