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
30204e08
Commit
30204e08
authored
Mar 21, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing bugs in eloquent relating to namespaces.
parent
8457238a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
relationship.php
laravel/database/eloquent/relationships/relationship.php
+2
-2
helpers.php
laravel/helpers.php
+1
-1
No files found.
laravel/database/eloquent/relationships/relationship.php
View file @
30204e08
...
@@ -62,7 +62,7 @@ abstract class Relationship extends Query {
...
@@ -62,7 +62,7 @@ abstract class Relationship extends Query {
// namespace, and we'll append "_id" to the name.
// namespace, and we'll append "_id" to the name.
if
(
is_object
(
$model
))
if
(
is_object
(
$model
))
{
{
$model
=
get_class
(
$model
);
$model
=
class_basename
(
$model
);
}
}
return
strtolower
(
basename
(
$model
)
.
'_id'
);
return
strtolower
(
basename
(
$model
)
.
'_id'
);
...
@@ -88,7 +88,7 @@ abstract class Relationship extends Query {
...
@@ -88,7 +88,7 @@ abstract class Relationship extends Query {
*/
*/
protected
function
foreign_key
()
protected
function
foreign_key
()
{
{
return
Relationship
::
foreign
(
$this
->
base
,
$this
->
foreign
);
return
static
::
foreign
(
$this
->
base
,
$this
->
foreign
);
}
}
}
}
\ No newline at end of file
laravel/helpers.php
View file @
30204e08
...
@@ -388,7 +388,7 @@ function class_basename($class)
...
@@ -388,7 +388,7 @@ function class_basename($class)
{
{
if
(
is_object
(
$class
))
$class
=
get_class
(
$class
);
if
(
is_object
(
$class
))
$class
=
get_class
(
$class
);
return
basename
(
$class
);
return
basename
(
str_replace
(
'\\'
,
'/'
,
$class
)
);
}
}
/**
/**
...
...
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