File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,8 @@ public function save($instance)
183
183
{
184
184
$ tuple = [];
185
185
186
+ $ size = count (get_object_vars ($ instance ));
187
+
186
188
foreach ($ this ->space ->getFormat () as $ index => $ info ) {
187
189
if (!property_exists ($ instance , $ info ['name ' ])) {
188
190
$ instance ->{$ info ['name ' ]} = null ;
@@ -191,6 +193,10 @@ public function save($instance)
191
193
$ instance ->{$ info ['name ' ]} = $ this ->space ->getMapper ()->getSchema ()
192
194
->formatValue ($ info ['type ' ], $ instance ->{$ info ['name ' ]});
193
195
$ tuple [$ index ] = $ instance ->{$ info ['name ' ]};
196
+
197
+ if (count ($ tuple ) == $ size ) {
198
+ break ;
199
+ }
194
200
}
195
201
196
202
$ key = $ this ->space ->getInstanceKey ($ instance );
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ public function testBasics()
76
76
$ this ->assertSame ($ nekufa ->id , 1 );
77
77
$ this ->assertSame ($ nekufa ->name , 'nekufa ' );
78
78
$ this ->assertSame ($ nekufa ->birthday , 19840127 );
79
+ $ this ->assertFalse (property_exists ($ nekufa , 'gender ' ));
79
80
80
81
$ person = $ mapper ->findOne ('person ' , ['birthday ' => '19840127 ' ]);
81
82
$ this ->assertSame ($ person , $ nekufa );
You can’t perform that action at this time.
0 commit comments