Pergunta

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?

Foi útil?

Solução

You can mix ORM with DB Query Builder:

$restricted_footer_links = ORM::factory('static')->get_in_footer_restricted()->limit(1)->offset(3)->find_all();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top