Skip to content

Commit 4e6b5a1

Browse files
committed
#11977 provided method documentation / example, as per @greg0ire's feedback
Ref: #11978 (comment)
1 parent 21b144f commit 4e6b5a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Internal/UnitOfWork/InsertBatch.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ public function __construct(
3737
/**
3838
* Note: Code in here is procedural/ugly due to it being in a hot path of the {@see UnitOfWork}
3939
*
40+
* This method will batch the given entity set by type, preserving their order. For example,
41+
* given an input [A1, A2, A3, B1, B2, A4, A5], it will create an [[A1, A2, A3], [B1, B2], [A4, A5]] batch.
42+
*
43+
* Entities for which the identifier needs to be generated or fetched by a sequence are put as single
44+
* items in a batch of their own, since it is unsafe to batch-insert them.
45+
*
4046
* @param list<TEntities> $entities
4147
*
4248
* @return list<self<TEntities>>

0 commit comments

Comments
 (0)