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

      1. <small id='yyP8H'></small><noframes id='yyP8H'>

        找不到 ID id(155) 的类型为“AppBundleEntityUser"的实体

        Entity of type #39;AppBundleEntityUser#39; for IDs id(155) was not found(找不到 ID id(155) 的类型为“AppBundleEntityUser的实体)

          1. <legend id='1U7fP'><style id='1U7fP'><dir id='1U7fP'><q id='1U7fP'></q></dir></style></legend>

            • <bdo id='1U7fP'></bdo><ul id='1U7fP'></ul>

              <small id='1U7fP'></small><noframes id='1U7fP'>

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

                    <tbody id='1U7fP'></tbody>
                • 本文介绍了找不到 ID id(155) 的类型为“AppBundleEntityUser"的实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我遍历一个组的用户(组#users,它是多对一关系)以显示用户电子邮件时,我收到此错误 Entity of type 'AppBundleEntityUser' for IDs id(155)找不到.但是,当我显示引发异常的用户时,我会看到:

                  When I iterate over users of one group (group#users and it's a ManyToOne relationship) to display the users emails, I get this error Entity of type 'AppBundleEntityUser' for IDs id(155) was not found. However, when I display the user for which the exception is raised I see this:

                  // In my controller
                  dump($groups[0]->getUser());
                  
                  // Output
                  User {#761 ▼
                    +__isInitialized__: false
                    #id: 155
                    #email: null
                    #firstName: null
                    #lastName: null
                    #roles: null
                     …2
                  }
                  

                  此外,此用户(其 id 等于 155)确实存在于我的数据库中.

                  Besides, this user (whose id equals 155) does exist in my database.

                  更新 1

                  public function getByCriteria(array $criteria)
                  {
                      $qb = $this->createQueryBuilder('g');
                      // ....
                  
                  
                      return $qb
                              ->getQuery()
                              // This does NOT change anything ?? Isn't this supposed to load related user??
                              // http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#temporarily-change-fetch-mode-in-dql
                              ->setFetchMode('class_namespace', 'user', ClassMetadata::FETCH_EAGER)
                              ->getResult();
                  }
                  

                  推荐答案

                  想通了!!实际上有一个启用的学说过滤器在每个 sql 查询中添加一个条件.当我得到一个组时,与其相关的用户不会从数据库中加载,只有它的 id 与组实体一起加载.当我尝试访问 id 以外的其他用户字段时,它会执行 sql join 查询.同样,学说过滤器将条件添加到连接条件中,这会导致结果为空.

                  Figured it out!! Actually there is a an enabled doctrine filter that adds one condition in every sql query. When I get one group, the user being related to it is not loaded from the database, only its id is loaded with the group entity. When I try to access other user field than the id, it performs the sql join query. Again, the doctrine filter adds the condition even to the join condition, which leads to an empty result.

                  所以错误信息显然具有误导性.

                  So the error message is clearly misleading.

                  这篇关于找不到 ID id(155) 的类型为“AppBundleEntityUser"的实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)
                  <legend id='O4aOI'><style id='O4aOI'><dir id='O4aOI'><q id='O4aOI'></q></dir></style></legend>

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

                        • <tfoot id='O4aOI'></tfoot>