<bdo id='4HKOK'></bdo><ul id='4HKOK'></ul>

      1. <i id='4HKOK'><tr id='4HKOK'><dt id='4HKOK'><q id='4HKOK'><span id='4HKOK'><b id='4HKOK'><form id='4HKOK'><ins id='4HKOK'></ins><ul id='4HKOK'></ul><sub id='4HKOK'></sub></form><legend id='4HKOK'></legend><bdo id='4HKOK'><pre id='4HKOK'><center id='4HKOK'></center></pre></bdo></b><th id='4HKOK'></th></span></q></dt></tr></i><div id='4HKOK'><tfoot id='4HKOK'></tfoot><dl id='4HKOK'><fieldset id='4HKOK'></fieldset></dl></div>
        <tfoot id='4HKOK'></tfoot>

        <small id='4HKOK'></small><noframes id='4HKOK'>

      2. <legend id='4HKOK'><style id='4HKOK'><dir id='4HKOK'><q id='4HKOK'></q></dir></style></legend>

        具有 ManyToOne 关联的实体上的 getArrayResult

        getArrayResult on entity with ManyToOne association(具有 ManyToOne 关联的实体上的 getArrayResult)

        • <legend id='RIDed'><style id='RIDed'><dir id='RIDed'><q id='RIDed'></q></dir></style></legend>

            <i id='RIDed'><tr id='RIDed'><dt id='RIDed'><q id='RIDed'><span id='RIDed'><b id='RIDed'><form id='RIDed'><ins id='RIDed'></ins><ul id='RIDed'></ul><sub id='RIDed'></sub></form><legend id='RIDed'></legend><bdo id='RIDed'><pre id='RIDed'><center id='RIDed'></center></pre></bdo></b><th id='RIDed'></th></span></q></dt></tr></i><div id='RIDed'><tfoot id='RIDed'></tfoot><dl id='RIDed'><fieldset id='RIDed'></fieldset></dl></div>
              <bdo id='RIDed'></bdo><ul id='RIDed'></ul>
              1. <tfoot id='RIDed'></tfoot>

                <small id='RIDed'></small><noframes id='RIDed'>

                    <tbody id='RIDed'></tbody>
                1. 本文介绍了具有 ManyToOne 关联的实体上的 getArrayResult的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  具有以下基本表(一对多关系)
                  客户端 - 有很多用户.
                  用户 - 每个用户属于单个客户端.

                  Having the follow basic tables (one-to-many relationship)
                  Client - Has many users.
                  Users - Each user belongs to single client.

                  在一个非常简单的例子中,如果我查询用户实体(Querybuilder)使用 getArrayResult() 我看到以下内容:

                  In a very simple example if I query the user entity (Querybuilder) with getArrayResult() I see the following:

                  1. 实际生成的 SQL 中包含了待处理的外键字段返回(即ClientID)
                  2. 实际返回的数据数组不包含外键场地.

                  现阶段我不需要返回外部数据,所以不需要加入关联的表.

                  At this stage I do not need to return foreign data and so do not need to join to the associated table.

                  所以问题是...
                  我如何或如何返回数组中的外键值?

                  So question is...
                  What or how do I return the foreign key value in my array?

                  查询是:

                     $qb = $this->_em->createQueryBuilder();  
                     $qb->select('e');  
                     $qb->from('EntityUser', 'e');  
                  

                  SQL 是:

                  SELECT w0_.Id AS Id0, w0_.Name AS Name2, w0_.ClientID AS ClientID7
                  FROM users w0_  
                  

                  推荐答案

                  尝试在执行之前在查询(而不是构建器)上设置 HINT_INCLUDE_META_COLUMNS 查询提示.

                  Try to set the HINT_INCLUDE_META_COLUMNS query hint on the query (not the builder) before you execute it.

                  $q->setHint(Query::HINT_INCLUDE_META_COLUMNS, true);
                  

                  这篇关于具有 ManyToOne 关联的实体上的 getArrayResult的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is PHP or PHP based web framework stateful or stateless?(PHP 或基于 PHP 的 Web 框架是有状态的还是无状态的?)
                  How to parse django style template tags(如何解析 django 样式模板标签)
                  What is a good setup for editing PHP in Emacs?(在 Emacs 中编辑 PHP 的好设置是什么?)
                  How to check whether specified PID is currently running without invoking ps from PHP?(如何在不从 PHP 调用 ps 的情况下检查指定的 PID 当前是否正在运行?)
                  What#39;s the difference between escapeshellarg and escapeshellcmd?(escapeshellarg 和escapeshellcmd 有什么区别?)
                  php in background exec() function(php 后台 exec() 函数)
                2. <legend id='rAixa'><style id='rAixa'><dir id='rAixa'><q id='rAixa'></q></dir></style></legend>
                  1. <small id='rAixa'></small><noframes id='rAixa'>

                    • <bdo id='rAixa'></bdo><ul id='rAixa'></ul>
                      <i id='rAixa'><tr id='rAixa'><dt id='rAixa'><q id='rAixa'><span id='rAixa'><b id='rAixa'><form id='rAixa'><ins id='rAixa'></ins><ul id='rAixa'></ul><sub id='rAixa'></sub></form><legend id='rAixa'></legend><bdo id='rAixa'><pre id='rAixa'><center id='rAixa'></center></pre></bdo></b><th id='rAixa'></th></span></q></dt></tr></i><div id='rAixa'><tfoot id='rAixa'></tfoot><dl id='rAixa'><fieldset id='rAixa'></fieldset></dl></div>
                        <tfoot id='rAixa'></tfoot>

                            <tbody id='rAixa'></tbody>