【发布时间】:2014-11-12 16:03:05
【问题描述】:
我通过调用将 OnDemandCollection 与 Propel 结合使用
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
我的查询。
这很棒,因为它可以根据需要处理尽可能多的结果(多达 200 000 个测试)。但是我需要得到结果的数量。
生成的 Propel Collection 的大小为 -1(可能是因为每一行都是按需加载的),所以我尝试了
count($collection)
$collection->count()
$ite_cloned = clone $collection->getIterator()
iterator_count($ite_cloned)
但没有人返回我的计数。
【问题讨论】:
标签: php collections propel