문제

I have a kohana 3.0.12 based website and I want to get the first 3 values from the database, then the following 3. I know that in Kohana v2.3.x it could be done using find_all(1,3) method, so I have tried:

$restricted_footer_links = ORM::factory('static')->get_in_footer_restricted()->find_all(1,3);

but it retrieves all the values, like I would have done with find_all(). Any idea of how I can get a range of the multiple records in Kohana 3.0.12?

도움이 되었습니까?

해결책

You can mix ORM with DB Query Builder:

$restricted_footer_links = ORM::factory('static')->get_in_footer_restricted()->limit(1)->offset(3)->find_all();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top