<bdo id='tImYo'></bdo><ul id='tImYo'></ul>
  1. <tfoot id='tImYo'></tfoot>

  2. <legend id='tImYo'><style id='tImYo'><dir id='tImYo'><q id='tImYo'></q></dir></style></legend>

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

      Doctrine Query Builder 使用数组

      Doctrine Query Builder using Array(Doctrine Query Builder 使用数组)

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

              <small id='4rYkk'></small><noframes id='4rYkk'>

                本文介绍了Doctrine Query Builder 使用数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个 id 数组:

                I have an array of id:

                Id_array; //array(2) { [0]=> int(9) [1]=> int(10) } 
                

                我只想使用 Id_array 选择用户;当我没有数组而只有一个整数时,我设法做到了:

                I simply want to select the users using Id_array; I managed to do this when I don't have an array but just an integer:

                $query = $em->createQuery('SELECT u FROM Users u WHERE u.id = ?1');
                $query->setParameter(1, 9); // I tested the value 9 here
                $users = $query->getResult(); 
                

                如何获取Id_array对应的所有用户?

                How can I fetch all the users that correspond to Id_array?

                推荐答案

                或者不使用查询生成器:

                Or without the query builder:

                $query = $em->createQuery('SELECT u FROM Users u WHERE u.id IN (:id)');
                $query->setParameter('id', array(1, 9));
                $users = $query->getResult();
                

                这篇关于Doctrine Query Builder 使用数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Converting between timezones in PHP(在 PHP 中的时区之间转换)
                PHP - strtotime, specify timezone(PHP - strtotime,指定时区)
                Get current date, given a timezone in PHP?(获取当前日期,给定 PHP 中的时区?)
                List of US Time Zones for PHP to use?(PHP 使用的美国时区列表?)
                How to detect Ambiguous and Invalid DateTime in PHP?(如何在 PHP 中检测不明确和无效的 DateTime?)
                How to update timezonedb in PHP (updating timezones info)?(如何在 PHP 中更新 timezonedb(更新时区信息)?)

                    <tbody id='BKX81'></tbody>
                  <legend id='BKX81'><style id='BKX81'><dir id='BKX81'><q id='BKX81'></q></dir></style></legend>

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

                  <tfoot id='BKX81'></tfoot>

                    • <bdo id='BKX81'></bdo><ul id='BKX81'></ul>
                    • <small id='BKX81'></small><noframes id='BKX81'>