Permalink
Browse files

Merge branch 'add-toarry-to-paginator' of https://github.com/rtablada…

…/framework-1 into rtablada-add-toarry-to-paginator
  • Loading branch information...
taylorotwell committed Oct 1, 2013
2 parents 6542303 + 05171c0 commit 5875b60d823b331ee838ebbe74fbc64a53c520a4
Showing with 24 additions and 1 deletion.
  1. +24 −1 src/Illuminate/Pagination/Paginator.php
@@ -5,8 +5,10 @@
use ArrayIterator;
use IteratorAggregate;
use Illuminate\Support\Collection;
use Illuminate\Support\Contracts\JsonableInterface;
use Illuminate\Support\Contracts\ArrayableInterface;
class Paginator implements ArrayAccess, Countable, IteratorAggregate {
class Paginator implements ArrayAccess, Countable, IteratorAggregate, JsonableInterface, ArrayableInterface {
/**
* The pagination environment.
@@ -422,4 +424,25 @@ public function offsetUnset($key)
unset($this->items[$key]);
}
/**
* Get the instance as an array.
*
* @return array
*/
public function toArray();
{
return $this->getCollection()->toArray();
}
/**
* Convert the object to its JSON representation.
*
* @param int $options
* @return string
*/
public function toJson($options = 0);
{
return $this->getCollection()->toJson($options);
}
}

0 comments on commit 5875b60

Please sign in to comment.