<small id='9H1Nj'></small><noframes id='9H1Nj'>

    • <bdo id='9H1Nj'></bdo><ul id='9H1Nj'></ul>

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

        <tfoot id='9H1Nj'></tfoot>
      1. <legend id='9H1Nj'><style id='9H1Nj'><dir id='9H1Nj'><q id='9H1Nj'></q></dir></style></legend>

      2. 对教义的 @OneToMany ArrayCollection 进行排序

        Sort a doctrine#39;s @OneToMany ArrayCollection(对教义的 @OneToMany ArrayCollection 进行排序)
        <i id='ORlJ8'><tr id='ORlJ8'><dt id='ORlJ8'><q id='ORlJ8'><span id='ORlJ8'><b id='ORlJ8'><form id='ORlJ8'><ins id='ORlJ8'></ins><ul id='ORlJ8'></ul><sub id='ORlJ8'></sub></form><legend id='ORlJ8'></legend><bdo id='ORlJ8'><pre id='ORlJ8'><center id='ORlJ8'></center></pre></bdo></b><th id='ORlJ8'></th></span></q></dt></tr></i><div id='ORlJ8'><tfoot id='ORlJ8'></tfoot><dl id='ORlJ8'><fieldset id='ORlJ8'></fieldset></dl></div>
          <tbody id='ORlJ8'></tbody>

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

        <legend id='ORlJ8'><style id='ORlJ8'><dir id='ORlJ8'><q id='ORlJ8'></q></dir></style></legend>
          <bdo id='ORlJ8'></bdo><ul id='ORlJ8'></ul>
              <tfoot id='ORlJ8'></tfoot>
                  本文介绍了对教义的 @OneToMany ArrayCollection 进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的问题很接近这个,但并不完全适合和我的.

                  My question is close to this one, but does not exactly fit with mine.

                  我在实体中有此列:

                  /**
                   * @var ArrayCollection[SubjectTag]
                   *
                   * @ORMOneToMany(targetEntity="SubjectTag", mappedBy="subject")
                   * @AssertCount(max = 10, maxMessage = "You can't create more than 10 tags.")
                   * @AssertValid()
                   */
                  protected $subjectTags;
                  

                  我想按在SubjectTag.position 中定义的位置对我的标签进行动态排序.

                  I want to dynamically order my tags by a position, defined in SubjectTag.position.

                  推荐答案

                  尝试使用 doctrine2 ORM 功能 对多关联排序 像这样:

                  Try using the doctrine2 ORM functionality for Ordering To-Many Associations like this:

                  /**
                   * @var ArrayCollection[SubjectTag]
                   *
                   * @ORMOneToMany(targetEntity="SubjectTag", mappedBy="subject")
                   * @ORMOrderBy({"position" = "ASC"})
                   * @AssertCount(max = 10, maxMessage = "You can't create more than 10 tags.")
                   * @AssertValid()
                   */
                  protected $subjectTags;
                  

                  希望对您有所帮助

                  这篇关于对教义的 @OneToMany ArrayCollection 进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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() 函数)

                      <tbody id='6OfEy'></tbody>

                          <bdo id='6OfEy'></bdo><ul id='6OfEy'></ul>

                          <small id='6OfEy'></small><noframes id='6OfEy'>

                          <tfoot id='6OfEy'></tfoot>
                          <legend id='6OfEy'><style id='6OfEy'><dir id='6OfEy'><q id='6OfEy'></q></dir></style></legend>

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