File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -1180,8 +1180,12 @@ public function value($column, $value)
11801180 */
11811181 public function set ($ array )
11821182 {
1183- foreach ($ array as $ key => $ item ) {
1184- $ this ->value ($ key , $ item );
1183+ if ($ this ->columns === array_keys ($ array )) {
1184+ $ this ->values ($ array );
1185+ } else {
1186+ foreach ($ array as $ key => $ item ) {
1187+ $ this ->value ($ key , $ item );
1188+ }
11851189 }
11861190
11871191 return $ this ;
Original file line number Diff line number Diff line change @@ -201,6 +201,30 @@ public function testInsert()
201201 ->getStored ();
202202
203203 $ this ->assertCount (8 , $ result );
204+
205+ SphinxQL::create (self ::$ conn )->insert ()
206+ ->into ('rt ' )
207+ ->set (array (
208+ 'id ' => 18 ,
209+ 'title ' => 'a multi set test ' ,
210+ 'content ' => 'has text ' ,
211+ 'gid ' => 9002
212+ ))
213+ ->set (array (
214+ 'id ' => 19 ,
215+ 'title ' => 'and a ' ,
216+ 'content ' => 'second set call ' ,
217+ 'gid ' => 9003
218+ ))
219+ ->execute ();
220+
221+ $ result = SphinxQL::create (self ::$ conn )->select ()
222+ ->from ('rt ' )
223+ ->execute ()
224+ ->getStored ();
225+
226+ $ this ->assertCount (10 , $ result );
227+
204228 }
205229
206230 /**
You can’t perform that action at this time.
0 commit comments