<legend id='elh7e'><style id='elh7e'><dir id='elh7e'><q id='elh7e'></q></dir></style></legend>
  • <small id='elh7e'></small><noframes id='elh7e'>

      <bdo id='elh7e'></bdo><ul id='elh7e'></ul>

    1. <tfoot id='elh7e'></tfoot>

      1. <i id='elh7e'><tr id='elh7e'><dt id='elh7e'><q id='elh7e'><span id='elh7e'><b id='elh7e'><form id='elh7e'><ins id='elh7e'></ins><ul id='elh7e'></ul><sub id='elh7e'></sub></form><legend id='elh7e'></legend><bdo id='elh7e'><pre id='elh7e'><center id='elh7e'></center></pre></bdo></b><th id='elh7e'></th></span></q></dt></tr></i><div id='elh7e'><tfoot id='elh7e'></tfoot><dl id='elh7e'><fieldset id='elh7e'></fieldset></dl></div>
      2. 来自实体的 Doctrine 2 更新

        Doctrine 2 update from entity(来自实体的 Doctrine 2 更新)

      3. <legend id='wJf2b'><style id='wJf2b'><dir id='wJf2b'><q id='wJf2b'></q></dir></style></legend>

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

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

                  <tbody id='wJf2b'></tbody>
                  <bdo id='wJf2b'></bdo><ul id='wJf2b'></ul>
                  本文介绍了来自实体的 Doctrine 2 更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否可以通过以下类似的方式更新实体:

                  Is it possible to update an entity in a similar way as below:

                  $data       = new ATest();  // my entity
                  $data->id   = 1;            // id 1 already exists, I just want to update this row
                  $data->name = "ORM Tested"; // changed the name
                  
                  $entityManager->persist($data);
                  $entityManager->flush();
                  

                  这将插入和更改对象的 id,而不是更新数据库中的现有行.

                  This will insert and change the id of the object instead of updating the existing row in the database.

                  推荐答案

                  我不得不使用

                  $entityManager->merge($data)
                  

                  这篇关于来自实体的 Doctrine 2 更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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() 函数)
                  <i id='yzwZE'><tr id='yzwZE'><dt id='yzwZE'><q id='yzwZE'><span id='yzwZE'><b id='yzwZE'><form id='yzwZE'><ins id='yzwZE'></ins><ul id='yzwZE'></ul><sub id='yzwZE'></sub></form><legend id='yzwZE'></legend><bdo id='yzwZE'><pre id='yzwZE'><center id='yzwZE'></center></pre></bdo></b><th id='yzwZE'></th></span></q></dt></tr></i><div id='yzwZE'><tfoot id='yzwZE'></tfoot><dl id='yzwZE'><fieldset id='yzwZE'></fieldset></dl></div>
                      <bdo id='yzwZE'></bdo><ul id='yzwZE'></ul>
                      <legend id='yzwZE'><style id='yzwZE'><dir id='yzwZE'><q id='yzwZE'></q></dir></style></legend>
                        1. <small id='yzwZE'></small><noframes id='yzwZE'>

                            <tbody id='yzwZE'></tbody>

                            <tfoot id='yzwZE'></tfoot>