File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 7
7
use InvalidArgumentException ;
8
8
use Stringable ;
9
9
10
+ use function array_key_exists ;
10
11
use function count ;
11
12
use function get_debug_type ;
12
13
use function implode ;
13
14
use function in_array ;
15
+ use function is_array ;
14
16
use function is_string ;
15
17
use function sprintf ;
16
18
@@ -33,6 +35,10 @@ abstract class Base implements Stringable
33
35
34
36
public function __construct (mixed $ args = [])
35
37
{
38
+ if (is_array ($ args ) && array_key_exists (0 , $ args ) && is_array ($ args [0 ])) {
39
+ $ args = $ args [0 ];
40
+ }
41
+
36
42
$ this ->addMultiple ($ args );
37
43
}
38
44
Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ public function testSimpleSelect(): void
80
80
$ this ->assertValidQueryBuilder ($ qb , 'SELECT u.id, u.username FROM Doctrine\Tests\Models\CMS\CmsUser u ' );
81
81
}
82
82
83
+ public function testSimpleSelectArray (): void
84
+ {
85
+ $ qb = $ this ->entityManager ->createQueryBuilder ()
86
+ ->from (CmsUser::class, 'u ' )
87
+ ->select (['u.id ' , 'u.username ' ]);
88
+
89
+ $ this ->assertValidQueryBuilder ($ qb , 'SELECT u.id, u.username FROM Doctrine\Tests\Models\CMS\CmsUser u ' );
90
+ }
91
+
83
92
public function testSimpleDelete (): void
84
93
{
85
94
$ qb = $ this ->entityManager ->createQueryBuilder ()
You can’t perform that action at this time.
0 commit comments