<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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                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>