Merge branch 'develop' of github.com:laravel/laravel into develop
This commit is contained in:
commit
3b8d4aec66
|
@ -194,8 +194,10 @@ public static function find($id)
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
private function _get()
|
||||
private function _get($columns = array('*'))
|
||||
{
|
||||
$this->query->select($columns);
|
||||
|
||||
return Hydrator::hydrate($this);
|
||||
}
|
||||
|
||||
|
@ -204,9 +206,9 @@ private function _get()
|
|||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private function _first()
|
||||
private function _first($columns = array('*'))
|
||||
{
|
||||
return (count($results = Hydrator::hydrate($this->take(1))) > 0) ? reset($results) : null;
|
||||
return (count($results = $this->take(1)->_get($columns)) > 0) ? reset($results) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -215,7 +217,7 @@ private function _first()
|
|||
* @param int $per_page
|
||||
* @return Paginator
|
||||
*/
|
||||
private function _paginate($per_page = null)
|
||||
private function _paginate($per_page = null, $columns = array('*'))
|
||||
{
|
||||
$total = $this->query->count();
|
||||
|
||||
|
@ -224,7 +226,7 @@ private function _paginate($per_page = null)
|
|||
$per_page = (property_exists(get_class($this), 'per_page')) ? static::$per_page : 20;
|
||||
}
|
||||
|
||||
return Paginator::make($this->for_page(Paginator::page($total, $per_page), $per_page)->get(), $total, $per_page);
|
||||
return Paginator::make($this->select($columns)->for_page(Paginator::page($total, $per_page), $per_page)->get(), $total, $per_page);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -60,6 +60,8 @@
|
|||
set_exception_handler(function($e)
|
||||
{
|
||||
require_once SYS_PATH.'exception/handler'.EXT;
|
||||
require_once SYS_PATH.'exception/examiner'.EXT;
|
||||
require_once SYS_PATH.'file'.EXT;
|
||||
|
||||
Exception\Handler::make($e)->handle();
|
||||
});
|
||||
|
@ -67,6 +69,8 @@
|
|||
set_error_handler(function($number, $error, $file, $line)
|
||||
{
|
||||
require_once SYS_PATH.'exception/handler'.EXT;
|
||||
require_once SYS_PATH.'exception/examiner'.EXT;
|
||||
require_once SYS_PATH.'file'.EXT;
|
||||
|
||||
Exception\Handler::make(new \ErrorException($error, $number, 0, $file, $line))->handle();
|
||||
});
|
||||
|
@ -76,6 +80,8 @@
|
|||
if ( ! is_null($error = error_get_last()))
|
||||
{
|
||||
require_once SYS_PATH.'exception/handler'.EXT;
|
||||
require_once SYS_PATH.'exception/examiner'.EXT;
|
||||
require_once SYS_PATH.'file'.EXT;
|
||||
|
||||
extract($error);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?php namespace System;
|
||||
<?php namespace Laravel;
|
||||
|
||||
class View {
|
||||
|
||||
|
@ -158,7 +158,7 @@ public function get()
|
|||
|
||||
if ( ! file_exists($this->path.$view.EXT))
|
||||
{
|
||||
throw new \Exception("View [$view] does not exist.");
|
||||
Exception\Handler::make(new Exception("View [$view] does not exist."))->handle();
|
||||
}
|
||||
|
||||
foreach ($this->data as &$data)
|
||||
|
|
Loading…
Reference in New Issue