File tree Expand file tree Collapse file tree
tests/Db/Expression/Function Expand file tree Collapse file tree Original file line number Diff line number Diff line change 136136- Enh #1031 : Optimize SQL generation for ` Not ` condition (@vjik )
137137- Chg #1037 : Change result type of ` QueryBuilderInterface::getExpressionBuilder() ` and
138138 ` DQLQueryBuilderInterface::getExpressionBuilder() ` methods to ` ExpressionBuilderInterface ` (@vjik )
139- - New #1029 : Add functions as expressions (@Tigrov )
139+ - New #1029 , # 1048 : Add functions as expressions (@Tigrov )
140140- Enh #1042 : Refactor ` AbstractDMLQueryBuilder ` class to ` upsert() ` method (@Tigrov )
141141- New #1040 , #1043 : Add ` DateTimeValue ` class (@vjik , @Tigrov )
142142
Original file line number Diff line number Diff line change 2323 */
2424final class ArrayMerge extends MultiOperandFunction
2525{
26+ private bool $ ordered = false ;
2627 private string |ColumnInterface $ type = '' ;
2728
29+ /**
30+ * Returns whether the result array should be ordered.
31+ */
32+ public function getOrdered (): bool
33+ {
34+ return $ this ->ordered ;
35+ }
36+
2837 /**
2938 * Returns the type of the operands. Empty string if not set.
3039 */
@@ -33,6 +42,15 @@ public function getType(): string|ColumnInterface
3342 return $ this ->type ;
3443 }
3544
45+ /**
46+ * Sets whether the result array should be ordered.
47+ */
48+ public function ordered (bool $ ordered = true ): self
49+ {
50+ $ this ->ordered = $ ordered ;
51+ return $ this ;
52+ }
53+
3654 /**
3755 * Sets the type of the operands.
3856 */
Original file line number Diff line number Diff line change @@ -25,4 +25,15 @@ public function testType(): void
2525 $ this ->assertSame ($ expression , $ expression ->type ($ intColumn ));
2626 $ this ->assertSame ($ intColumn , $ expression ->getType ());
2727 }
28+
29+ public function testOrdered (): void
30+ {
31+ $ expression = new ArrayMerge ();
32+
33+ $ this ->assertFalse ($ expression ->getOrdered ());
34+ $ this ->assertSame ($ expression , $ expression ->ordered ());
35+ $ this ->assertTrue ($ expression ->getOrdered ());
36+ $ this ->assertSame ($ expression , $ expression ->ordered (false ));
37+ $ this ->assertFalse ($ expression ->getOrdered ());
38+ }
2839}
You can’t perform that action at this time.
0 commit comments