0

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?

matino
  • 17,199
  • 8
  • 49
  • 58
dana
  • 5,168
  • 20
  • 75
  • 116

1 Answers1

1

You can mix ORM with DB Query Builder:

$restricted_footer_links = ORM::factory('static')->get_in_footer_restricted()->limit(1)->offset(3)->find_all();
matino
  • 17,199
  • 8
  • 49
  • 58
  • if i want to take the first three i put: $restricted_footer_links = ORM::factory('static')->get_in_footer_restricted()->limit(3)->offset(3)->find_all(); and if i want to take the next three ones? – dana Nov 30 '11 at 15:06
  • strangely enough, it doesn;t work. i'll look more on it. thanks! – dana Nov 30 '11 at 15:31