j4mie/idiorm — Issue #48: If fewer results are available than passed to limit(), empty elements appear
Author: pthomsen
Created: 2011-10-27 19:28:34+00:00
State: open

Say I use the following:

```php

$page_size = 100;
$page_number = 3;
$users = Model::factory('BlergUsers')
->where('session_id', $session)
->where('user_type',$user_type)
->order_by_asc('id')
->offset($page_size * $page_number)
->limit($page_size)
->find_many();

foreach($users as $user)
{
$username = $user->name;
}
```

I get an array that is 100 elements long, no matter how many rows are really available.

Should there not just be the number of rows returned from the query?

Thanks,
Per