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
c9e0739d
Commit
c9e0739d
authored
Dec 20, 2015
by
Jens Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix morphTo
parent
a1769cfb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
HybridRelations.php
src/Jenssegers/Mongodb/Eloquent/HybridRelations.php
+1
-1
MorphTo.php
src/Jenssegers/Mongodb/Relations/MorphTo.php
+19
-0
test.php
test.php
+1
-0
No files found.
src/Jenssegers/Mongodb/Eloquent/HybridRelations.php
View file @
c9e0739d
...
...
@@ -185,7 +185,7 @@ trait HybridRelations {
// use that to get both the class and foreign key that will be utilized.
if
(
is_null
(
$name
))
{
list
(
$current
,
$caller
)
=
debug_backtrace
(
false
,
2
);
list
(
$current
,
$caller
)
=
debug_backtrace
(
DEBUG_BACKTRACE_IGNORE_ARGS
,
2
);
$name
=
Str
::
snake
(
$caller
[
'function'
]);
}
...
...
src/Jenssegers/Mongodb/Relations/MorphTo.php
View file @
c9e0739d
...
...
@@ -18,4 +18,23 @@ class MorphTo extends EloquentMorphTo {
}
}
/**
* Get all of the relation results for a type.
*
* @param string $type
* @return \Illuminate\Database\Eloquent\Collection
*/
protected
function
getResultsByType
(
$type
)
{
$instance
=
$this
->
createModelByType
(
$type
);
$key
=
$instance
->
getKeyName
();
$query
=
$instance
->
newQuery
();
$query
=
$this
->
useWithTrashed
(
$query
);
return
$query
->
whereIn
(
$key
,
$this
->
gatherKeysByType
(
$type
)
->
all
())
->
get
();
}
}
test.php
0 → 100644
View file @
c9e0739d
<?php
require
'vendor/autoload.php'
;
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