CakePHP Reconnect to DB

后端 未结 1 1249
鱼传尺愫
鱼传尺愫 2021-01-20 19:17

I have a script that inserts an object into the database and then I have like 20 000 other little objects to be inserted. So I save the other objects into an array and save

1条回答
  •  无人及你
    2021-01-20 19:38

    You can in your model.

    $this->ModelName->getDatasource()->disconnect(); 
        //do stuff
    $this->ModelName->getDatasource()->connect(); 
    

    0 讨论(0)
提交回复
热议问题