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
5ba231a1
Commit
5ba231a1
authored
Feb 18, 2017
by
Jens Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making progress on fixing relations
parent
924837f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
HasMany.php
src/Jenssegers/Mongodb/Relations/HasMany.php
+10
-0
Client.php
tests/models/Client.php
+1
-1
No files found.
src/Jenssegers/Mongodb/Relations/HasMany.php
View file @
5ba231a1
...
@@ -5,6 +5,16 @@ use Illuminate\Database\Eloquent\Relations\HasMany as EloquentHasMany;
...
@@ -5,6 +5,16 @@ use Illuminate\Database\Eloquent\Relations\HasMany as EloquentHasMany;
class
HasMany
extends
EloquentHasMany
class
HasMany
extends
EloquentHasMany
{
{
/**
* Get the plain foreign key.
*
* @return string
*/
public
function
getForeignKeyName
()
{
return
$this
->
foreignKey
;
}
/**
/**
* Get the key for comparing against the parent key in "has" query.
* Get the key for comparing against the parent key in "has" query.
*
*
...
...
tests/models/Client.php
View file @
5ba231a1
...
@@ -19,6 +19,6 @@ class Client extends Eloquent
...
@@ -19,6 +19,6 @@ class Client extends Eloquent
public
function
addresses
()
public
function
addresses
()
{
{
return
$this
->
hasMany
(
'Address'
,
'data.
address
_id'
,
'data.client_id'
);
return
$this
->
hasMany
(
'Address'
,
'data.
client
_id'
,
'data.client_id'
);
}
}
}
}
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