Doctrine - insert multiple rows with just one save()

前端 未结 5 1253
死守一世寂寞
死守一世寂寞 2020-12-08 21:03

How do I insert multiple rows into table calling save() method once in Doctrine?

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 21:52

    I took a look into the code of the "save" method of the Doctrine (1.2.x) "Collection.php" and all I saw is something like this:

    foreach ($this->getData() as $key => $record) {
       $record->save($conn);
    }
    

    How should this ever insert all records with one mysql INSERT?

提交回复
热议问题