Skip to content

Conversation

@ziaratban
Copy link
Contributor

@ziaratban ziaratban commented Mar 4, 2020

Q A
Is bugfix? no
New feature? yes
Breaks BC? no
Tests pass? yes
MyActiveRecord::$batchInsertSize = 1000; foreach($myData as $data){ $obj = new MyActiveRecord(); $obj->field1 = 'data1'; $obj->field2 = 'data2'; $obj->field3 = 'data3'; $obj->batchSave(); #or batchInsert(); #no any database operation execute until count of insert operation equal MyActiveRecord::$batchInsertSize } MyActiveRecord::flushBatchInsert(); // executing the remaining operations. required.

or batchDelete() or batchUpdate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants