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
ab64c586
Commit
ab64c586
authored
Apr 03, 2014
by
Jens Segers
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:jenssegers/Laravel-MongoDB
parents
b32d35e3
f9287f52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
DatabaseReminderRepository.php
src/Jenssegers/Mongodb/Auth/DatabaseReminderRepository.php
+5
-5
EmbedsMany.php
src/Jenssegers/Mongodb/Relations/EmbedsMany.php
+1
-0
RelationsTest.php
tests/RelationsTest.php
+1
-0
No files found.
src/Jenssegers/Mongodb/Auth/DatabaseReminderRepository.php
View file @
ab64c586
...
...
@@ -10,16 +10,16 @@ class DatabaseReminderRepository extends \Illuminate\Auth\Reminders\DatabaseRemi
*/
protected
function
reminderExpired
(
$reminder
)
{
// Convert to
object
so that we can pass it to the parent method
if
(
is_
array
(
$reminder
))
// Convert to
array
so that we can pass it to the parent method
if
(
is_
object
(
$reminder
))
{
$reminder
=
(
object
)
$reminder
;
$reminder
=
(
array
)
$reminder
;
}
// Convert the DateTime object that got saved to MongoDB
if
(
is_array
(
$reminder
->
created_at
))
if
(
is_array
(
$reminder
[
'created_at'
]
))
{
$reminder
->
created_at
=
$reminder
->
created_at
[
'date'
]
+
$reminder
->
created_at
[
'timezone'
];
$reminder
[
'created_at'
]
=
$reminder
[
'created_at'
][
'date'
]
+
$reminder
[
'created_at'
]
[
'timezone'
];
}
return
parent
::
reminderExpired
(
$reminder
);
...
...
src/Jenssegers/Mongodb/Relations/EmbedsMany.php
View file @
ab64c586
...
...
@@ -487,6 +487,7 @@ class EmbedsMany extends Relation {
// Attatch the parent relation to the embedded model.
$model
->
setRelation
(
$this
->
foreignKey
,
$this
->
parent
);
$model
->
setHidden
(
array_merge
(
$model
->
getHidden
(),
array
(
$this
->
foreignKey
)));
$models
[]
=
$model
;
}
...
...
tests/RelationsTest.php
View file @
ab64c586
...
...
@@ -337,6 +337,7 @@ class RelationsTest extends TestCase {
$this
->
assertInstanceOf
(
'DateTime'
,
$address
->
created_at
);
$this
->
assertInstanceOf
(
'DateTime'
,
$address
->
updated_at
);
$this
->
assertInstanceOf
(
'User'
,
$address
->
user
);
$this
->
assertEmpty
(
$address
->
relationsToArray
());
// prevent infinite loop
$user
=
User
::
find
(
$user
->
_id
);
$user
->
addresses
()
->
save
(
new
Address
(
array
(
'city'
=>
'Bruxelles'
)));
...
...
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