【发布时间】:2019-12-21 09:48:50
【问题描述】:
我们如何在 Silverstripe 3 中过滤 ArrayList?
其中 getVideosfromCategories() 返回一个合并的 ArrayList
我需要类似的东西:
$this->getVideosfromCategories()->filter('ID:LessThan', $id)->sort(array('ID' => 'DESC'))->first()
这些过滤器 (filter('ID:LessThan', $id)) 仅适用于 DataList 吗?
如何过滤我的 ArrayList?
【问题讨论】:
-
ArrayList和DataList都实现了SS_Filterable接口。您应该能够以相同的方式过滤两者。确切的问题是什么?
标签: arraylist filter silverstripe