morgan / kohana-paginate

Paginate abstraction supporting Database, ORM, ORM-REST and Dispatch.
MIT License
23 stars 11 forks source link

Adding a where condition #6

Closed erralb closed 10 years ago

erralb commented 10 years ago

Hi,

Is it possible to add a ->where('col','=','something') ORM condition to a paginate object ?

morgan commented 10 years ago

Hello @ierpe,

You can apply the "where" condition to the ORM object prior to passing it into Paginate. If you reference the documentation (http://dev.morgan.ly/kohana/v3.3/index.php/guide/paginate/basics), you'll see where the ORM object is created. Just manipulate the object as needed and then pass it into Paginate. Just make sure to pass the ORM object without executing it (calling find, etc), since Paginate is responsible for pulling the result.

Please let me know if you have any questions.

Thank you.

erralb commented 10 years ago

Thanks for the answer!