$rows = MessageQuery::create(); $index = 0; foreach($rows as $row){ if(index == 3){ $var = $row->findId(); } index++; }