Skip to content

Commit

Permalink
Merge branch 'add-toarry-to-paginator' of https://github.com/rtablada…
Browse files Browse the repository at this point in the history
…/framework-1 into rtablada-add-toarry-to-paginator
  • Loading branch information
taylorotwell committed Oct 1, 2013
2 parents 6542303 + 05171c0 commit 5875b60
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/Illuminate/Pagination/Paginator.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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.