kohana 3.0.12获取多个记录的范围

时间:2011-11-30 12:28:13

标签: php orm kohana kohana-3.0

我有一个基于kohana 3.0.12的网站,我想从数据库中获取前3个值,然后是以下3个。 我知道在Kohana v2.3.x中可以使用find_all(1,3)方法完成,所以我尝试过:

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

但它会检索所有值,就像我对find_all()所做的那样。 知道如何在Kohana 3.0.12中获得多个记录的范围?

1 个答案:

答案 0 :(得分:1)

您可以将ORM与DB Query Builder混合使用:

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