我尝试按以下方式执行:
$q = PhotographerQuery::create();
$photographer = $q->limit(1)->find();
while ($photographer) {
$id = $photographer->getId();
echo "$id {$photographer->getName()}\n";
// do something - no idea what ... limit() supports only one parameter to
// specify quontity of elements to be fetched
$photographer = $q->limit(1)->somethingElse()->find();
}
如何修改它以使此脚本启动并运行?
答案 0 :(得分:1)
你需要使用offset
,但我真的怀疑你真的想要那样。对于此类用例,我们进行了按需水合:http://propelorm.org/documentation/03-basic-crud.html#collections-and-on-demand-hydration