From 6904cf119d359f51c12da326e5dc0f2b046cae43 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 14 Sep 2011 20:55:58 -0500 Subject: [PATCH] fixed bug in eloquent causing ids to overlap. --- public/index.php | 2 +- system/db/eloquent/model.php | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/public/index.php b/public/index.php index 933ba787..5d27317a 100644 --- a/public/index.php +++ b/public/index.php @@ -3,7 +3,7 @@ * Laravel - A clean and classy framework for PHP web development. * * @package Laravel - * @version 1.5.8 + * @version 1.5.9 * @author Taylor Otwell * @link http://laravel.com */ diff --git a/system/db/eloquent/model.php b/system/db/eloquent/model.php index ea4b61bf..0f2d7153 100644 --- a/system/db/eloquent/model.php +++ b/system/db/eloquent/model.php @@ -194,10 +194,8 @@ public static function find($id) * * @return array */ - private function _get($columns = array('*')) + private function _get() { - $this->query->select($columns); - return Hydrator::hydrate($this); } @@ -206,9 +204,9 @@ private function _get($columns = array('*')) * * @return mixed */ - private function _first($columns = array('*')) + private function _first() { - return (count($results = $this->take(1)->_get($columns)) > 0) ? reset($results) : null; + return (count($results = $this->take(1)->_get()) > 0) ? reset($results) : null; } /** @@ -217,7 +215,7 @@ private function _first($columns = array('*')) * @param int $per_page * @return Paginator */ - private function _paginate($per_page = null, $columns = array('*')) + private function _paginate($per_page = null) { $total = $this->query->count(); @@ -226,7 +224,7 @@ private function _paginate($per_page = null, $columns = array('*')) $per_page = (property_exists(get_class($this), 'per_page')) ? static::$per_page : 20; } - return Paginator::make($this->select($columns)->for_page(Paginator::page($total, $per_page), $per_page)->get(), $total, $per_page); + return Paginator::make($this->for_page(Paginator::page($total, $per_page), $per_page)->get(), $total, $per_page); } /**