Commit 62611090 authored by David Furnes's avatar David Furnes

Fix issue using chunkById with ObjectIDs.

parent 9dd27175
......@@ -143,6 +143,14 @@ class Builder extends EloquentBuilder
return parent::decrement($column, $amount, $extra);
}
/**
* @inheritdoc
*/
public function chunkById($count, callable $callback, $column = '_id', $alias = null)
{
return parent::chunkById($count, $callback, $column, $alias);
}
/**
* @inheritdoc
*/
......
......@@ -600,6 +600,28 @@ class Builder extends BaseBuilder
return $this->increment($column, -1 * $amount, $extra, $options);
}
/**
* @inheritdoc
*/
public function chunkById($count, callable $callback, $column = '_id', $alias = null)
{
return parent::chunkById($count, $callback, $column, $alias);
}
/**
* @inheritdoc
*/
public function forPageAfterId($perPage = 15, $lastId = 0, $column = '_id')
{
// When using ObjectIDs to paginate, we need to use a hex string as the
// "minimum" ID rather than the integer zero so the '$lt' query works.
if ($column === '_id' && $lastId === 0) {
$lastId = '000000000000000000000000';
}
return parent::forPageAfterId($perPage, $lastId, $column);
}
/**
* @inheritdoc
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment