Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
3b8d4aec
Commit
3b8d4aec
authored
Aug 18, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:laravel/laravel into develop
parents
399892dd
b3a2c353
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
model.php
system/db/eloquent/model.php
+7
-5
laravel.php
system/laravel.php
+6
-0
view.php
system/view.php
+2
-2
No files found.
system/db/eloquent/model.php
View file @
3b8d4aec
...
...
@@ -194,8 +194,10 @@ abstract class Model {
*
* @return array
*/
private
function
_get
()
private
function
_get
(
$columns
=
array
(
'*'
)
)
{
$this
->
query
->
select
(
$columns
);
return
Hydrator
::
hydrate
(
$this
);
}
...
...
@@ -204,9 +206,9 @@ abstract class Model {
*
* @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 @@ abstract class Model {
* @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 @@ abstract class Model {
$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
);
}
/**
...
...
system/laravel.php
View file @
3b8d4aec
...
...
@@ -60,6 +60,8 @@ ini_set('display_errors', 'Off');
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_exception_handler(function($e)
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 @@ register_shutdown_function(function()
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
);
...
...
system/view.php
View file @
3b8d4aec
<?php
namespace
System
;
<?php
namespace
Laravel
;
class
View
{
...
...
@@ -158,7 +158,7 @@ class View {
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment