Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
Details
Activity
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
sinan
laravel-mongodb
Commits
e234d935
Commit
e234d935
authored
Sep 24, 2015
by
Jens Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue #596
parent
9737b9bb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
HybridRelations.php
src/Jenssegers/Mongodb/Eloquent/HybridRelations.php
+6
-6
No files found.
src/Jenssegers/Mongodb/Eloquent/HybridRelations.php
View file @
e234d935
...
@@ -22,7 +22,7 @@ trait HybridRelations {
...
@@ -22,7 +22,7 @@ trait HybridRelations {
public
function
hasOne
(
$related
,
$foreignKey
=
null
,
$localKey
=
null
)
public
function
hasOne
(
$related
,
$foreignKey
=
null
,
$localKey
=
null
)
{
{
// Check if it is a relation with an original model.
// Check if it is a relation with an original model.
if
(
$related
instanceof
Model
)
if
(
!
is_subclass_of
(
$related
,
'Jenssegers\Mongodb\Model'
)
)
{
{
return
parent
::
hasOne
(
$related
,
$foreignKey
,
$localKey
);
return
parent
::
hasOne
(
$related
,
$foreignKey
,
$localKey
);
}
}
...
@@ -49,7 +49,7 @@ trait HybridRelations {
...
@@ -49,7 +49,7 @@ trait HybridRelations {
public
function
morphOne
(
$related
,
$name
,
$type
=
null
,
$id
=
null
,
$localKey
=
null
)
public
function
morphOne
(
$related
,
$name
,
$type
=
null
,
$id
=
null
,
$localKey
=
null
)
{
{
// Check if it is a relation with an original model.
// Check if it is a relation with an original model.
if
(
$related
instanceof
Model
)
if
(
!
is_subclass_of
(
$related
,
'Jenssegers\Mongodb\Model'
)
)
{
{
return
parent
::
morphOne
(
$related
,
$name
,
$type
,
$id
,
$localKey
);
return
parent
::
morphOne
(
$related
,
$name
,
$type
,
$id
,
$localKey
);
}
}
...
@@ -76,7 +76,7 @@ trait HybridRelations {
...
@@ -76,7 +76,7 @@ trait HybridRelations {
public
function
hasMany
(
$related
,
$foreignKey
=
null
,
$localKey
=
null
)
public
function
hasMany
(
$related
,
$foreignKey
=
null
,
$localKey
=
null
)
{
{
// Check if it is a relation with an original model.
// Check if it is a relation with an original model.
if
(
$related
instanceof
Model
)
if
(
!
is_subclass_of
(
$related
,
'Jenssegers\Mongodb\Model'
)
)
{
{
return
parent
::
hasMany
(
$related
,
$foreignKey
,
$localKey
);
return
parent
::
hasMany
(
$related
,
$foreignKey
,
$localKey
);
}
}
...
@@ -103,7 +103,7 @@ trait HybridRelations {
...
@@ -103,7 +103,7 @@ trait HybridRelations {
public
function
morphMany
(
$related
,
$name
,
$type
=
null
,
$id
=
null
,
$localKey
=
null
)
public
function
morphMany
(
$related
,
$name
,
$type
=
null
,
$id
=
null
,
$localKey
=
null
)
{
{
// Check if it is a relation with an original model.
// Check if it is a relation with an original model.
if
(
$related
instanceof
Model
)
if
(
!
is_subclass_of
(
$related
,
'Jenssegers\Mongodb\Model'
)
)
{
{
return
parent
::
morphMany
(
$related
,
$name
,
$type
,
$id
,
$localKey
);
return
parent
::
morphMany
(
$related
,
$name
,
$type
,
$id
,
$localKey
);
}
}
...
@@ -144,7 +144,7 @@ trait HybridRelations {
...
@@ -144,7 +144,7 @@ trait HybridRelations {
}
}
// Check if it is a relation with an original model.
// Check if it is a relation with an original model.
if
(
$related
instanceof
Model
)
if
(
!
is_subclass_of
(
$related
,
'Jenssegers\Mongodb\Model'
)
)
{
{
return
parent
::
belongsTo
(
$related
,
$foreignKey
,
$otherKey
,
$relation
);
return
parent
::
belongsTo
(
$related
,
$foreignKey
,
$otherKey
,
$relation
);
}
}
...
@@ -235,7 +235,7 @@ trait HybridRelations {
...
@@ -235,7 +235,7 @@ trait HybridRelations {
}
}
// Check if it is a relation with an original model.
// Check if it is a relation with an original model.
if
(
$related
instanceof
Model
)
if
(
!
is_subclass_of
(
$related
,
'Jenssegers\Mongodb\Model'
)
)
{
{
return
parent
::
belongsToMany
(
$related
,
$collection
,
$foreignKey
,
$otherKey
,
$relation
);
return
parent
::
belongsToMany
(
$related
,
$collection
,
$foreignKey
,
$otherKey
,
$relation
);
}
}
...
...
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