<bdo id='XYYMv'></bdo><ul id='XYYMv'></ul>
<tfoot id='XYYMv'></tfoot>

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

      1. <i id='XYYMv'><tr id='XYYMv'><dt id='XYYMv'><q id='XYYMv'><span id='XYYMv'><b id='XYYMv'><form id='XYYMv'><ins id='XYYMv'></ins><ul id='XYYMv'></ul><sub id='XYYMv'></sub></form><legend id='XYYMv'></legend><bdo id='XYYMv'><pre id='XYYMv'><center id='XYYMv'></center></pre></bdo></b><th id='XYYMv'></th></span></q></dt></tr></i><div id='XYYMv'><tfoot id='XYYMv'></tfoot><dl id='XYYMv'><fieldset id='XYYMv'></fieldset></dl></div>
      2. <legend id='XYYMv'><style id='XYYMv'><dir id='XYYMv'><q id='XYYMv'></q></dir></style></legend>
      3. Doctrine2 findBy 关系对象触发字符串转换错误

        Doctrine2 findBy relationship object triggers string conversion error(Doctrine2 findBy 关系对象触发字符串转换错误)
          <bdo id='0wfvg'></bdo><ul id='0wfvg'></ul>

          <small id='0wfvg'></small><noframes id='0wfvg'>

          <tfoot id='0wfvg'></tfoot>

                  <tbody id='0wfvg'></tbody>
              1. <i id='0wfvg'><tr id='0wfvg'><dt id='0wfvg'><q id='0wfvg'><span id='0wfvg'><b id='0wfvg'><form id='0wfvg'><ins id='0wfvg'></ins><ul id='0wfvg'></ul><sub id='0wfvg'></sub></form><legend id='0wfvg'></legend><bdo id='0wfvg'><pre id='0wfvg'><center id='0wfvg'></center></pre></bdo></b><th id='0wfvg'></th></span></q></dt></tr></i><div id='0wfvg'><tfoot id='0wfvg'></tfoot><dl id='0wfvg'><fieldset id='0wfvg'></fieldset></dl></div>
                <legend id='0wfvg'><style id='0wfvg'><dir id='0wfvg'><q id='0wfvg'></q></dir></style></legend>
                  本文介绍了Doctrine2 findBy 关系对象触发字符串转换错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  假设我在 Doctrine2 中有两个相互关联的实体,ModelsUser 和 ModelsComment.如果我在 Doctrine 2.0.0 中这样做...

                  Say I have two entities in Doctrine2 that are related to each other, ModelsUser and ModelsComment. If I do this in Doctrine 2.0.0...

                  <?php
                  // $em instanceof EntityManager, $user instanceof ModelsUser
                  $comments = $em->getRepository('ModelsComment')
                      ->findBy(array('user' => $user, 'public' => true));
                  

                  ...我收到一个 PHP 错误:

                  ...I get a PHP error:

                  严重性:注意

                  消息:ModelsUser 类对象到字符串的转换

                  Message: Object of class ModelsUser to string conversion

                  文件名:DBAL/Connection.php

                  Filename: DBAL/Connection.php

                  行号:574

                  这不应该发生,对吧?如果我使用 QueryBuilder 和 setParameter('user', $user) 它会按预期工作.

                  This shouldn't happen, right? If I use the QueryBuilder and setParameter('user', $user) it works as expected.

                  推荐答案

                  允许按关系查询,但必须在那里传递标识符.尚不支持按对象查询,只会在 2.1 中实现.

                  Query by relationship is allowed, but you have to pass the Identifier in there. Query by object is not yet supported and will only make it into 2.1.

                  <?php
                  // $em instanceof EntityManager, $user instanceof ModelsUser
                  $comments = $em->getRepository('ModelsComment')
                  ->findBy(array('user' => $user->getId(), 'public' => true));
                  

                  这篇关于Doctrine2 findBy 关系对象触发字符串转换错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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='0ug4K'><style id='0ug4K'><dir id='0ug4K'><q id='0ug4K'></q></dir></style></legend>
                    • <bdo id='0ug4K'></bdo><ul id='0ug4K'></ul>
                        <tbody id='0ug4K'></tbody>

                          <small id='0ug4K'></small><noframes id='0ug4K'>

                        1. <tfoot id='0ug4K'></tfoot>

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