File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,16 @@ class DatabaseReminderRepository extends \Illuminate\Auth\Reminders\DatabaseRemi
1010 */
1111 protected function reminderExpired ($ reminder )
1212 {
13- // Convert to object so that we can pass it to the parent method
14- if (is_array ($ reminder ))
13+ // Convert to array so that we can pass it to the parent method
14+ if (is_object ($ reminder ))
1515 {
16- $ reminder = (object ) $ reminder ;
16+ $ reminder = (array ) $ reminder ;
1717 }
1818
1919 // Convert the DateTime object that got saved to MongoDB
20- if (is_array ($ reminder-> created_at ))
20+ if (is_array ($ reminder[ ' created_at ' ] ))
2121 {
22- $ reminder-> created_at = $ reminder-> created_at ['date ' ] + $ reminder-> created_at ['timezone ' ];
22+ $ reminder[ ' created_at ' ] = $ reminder[ ' created_at ' ] ['date ' ] + $ reminder[ ' created_at ' ] ['timezone ' ];
2323 }
2424
2525 return parent ::reminderExpired ($ reminder );
Original file line number Diff line number Diff line change @@ -487,6 +487,7 @@ protected function toCollection(array $results = array())
487487
488488 // Attatch the parent relation to the embedded model.
489489 $ model ->setRelation ($ this ->foreignKey , $ this ->parent );
490+ $ model ->setHidden (array_merge ($ model ->getHidden (), array ($ this ->foreignKey )));
490491
491492 $ models [] = $ model ;
492493 }
Original file line number Diff line number Diff line change @@ -337,6 +337,7 @@ public function testEmbedsManySave()
337337 $ this ->assertInstanceOf ('DateTime ' , $ address ->created_at );
338338 $ this ->assertInstanceOf ('DateTime ' , $ address ->updated_at );
339339 $ this ->assertInstanceOf ('User ' , $ address ->user );
340+ $ this ->assertEmpty ($ address ->relationsToArray ()); // prevent infinite loop
340341
341342 $ user = User::find ($ user ->_id );
342343 $ user ->addresses ()->save (new Address (array ('city ' => 'Bruxelles ' )));
You can’t perform that action at this time.
0 commit comments