Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用联接表更改条令结果中的数组结果层次结构_Php_Sql_Symfony_Multidimensional Array_Doctrine - Fatal编程技术网

Php 如何使用联接表更改条令结果中的数组结果层次结构

Php 如何使用联接表更改条令结果中的数组结果层次结构,php,sql,symfony,multidimensional-array,doctrine,Php,Sql,Symfony,Multidimensional Array,Doctrine,使用联接的我的查询:(in实体不是关系) 但我需要这样的格式: array(149) { [0]=> array(9) { data from table with alias f ['joined table']=> array(4) { data from table with alias it } } [1]=> array(9) { data from table with alias f ['joined table']=> ar

使用联接的我的查询:(in实体不是关系)

但我需要这样的格式:

array(149) {
[0]=>
array(9) {
 data from table with alias f
  ['joined table']=>
  array(4) {
   data from table with alias it
  }
}

[1]=>
array(9) {
 data from table with alias f
  ['joined table']=>
  array(4) {
   data from table with alias it
  }
}

只是层次结构。。。数组中的一个键=一个传单(一个项目)和加入的数据…

似乎您只需要从
getResult()
中删除参数(或者用默认值
::hydroge\u OBJECT


键“joined table”不会出现,但您将根据您的实体获得数据结构。

否。。。不是多维数组,而是对象数组。。。
array(149) {
[0]=>
array(9) {
 data from table with alias f
}
[1]=>
array(4) {
 data from table with alias it
}
[2]=>
array(9) {
 data from table with alias f
}
[3]=>
array(4) {
 data from table with alias it
}
array(149) {
[0]=>
array(9) {
 data from table with alias f
  ['joined table']=>
  array(4) {
   data from table with alias it
  }
}

[1]=>
array(9) {
 data from table with alias f
  ['joined table']=>
  array(4) {
   data from table with alias it
  }
}