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

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

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

      如何使用具有比较标准的 findBy 方法

      How to use a findBy method with comparative criteria(如何使用具有比较标准的 findBy 方法)

          <tbody id='tpoJz'></tbody>
      1. <small id='tpoJz'></small><noframes id='tpoJz'>

          • <bdo id='tpoJz'></bdo><ul id='tpoJz'></ul>
            <i id='tpoJz'><tr id='tpoJz'><dt id='tpoJz'><q id='tpoJz'><span id='tpoJz'><b id='tpoJz'><form id='tpoJz'><ins id='tpoJz'></ins><ul id='tpoJz'></ul><sub id='tpoJz'></sub></form><legend id='tpoJz'></legend><bdo id='tpoJz'><pre id='tpoJz'><center id='tpoJz'></center></pre></bdo></b><th id='tpoJz'></th></span></q></dt></tr></i><div id='tpoJz'><tfoot id='tpoJz'></tfoot><dl id='tpoJz'><fieldset id='tpoJz'></fieldset></dl></div>
            <tfoot id='tpoJz'></tfoot>
              <legend id='tpoJz'><style id='tpoJz'><dir id='tpoJz'><q id='tpoJz'></q></dir></style></legend>
                本文介绍了如何使用具有比较标准的 findBy 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我需要使用使用比较标准(不仅是精确标准)的魔术查找器" findBy 方法.换句话说,我需要做这样的事情:

                I'd need to use a "magic finder" findBy method using comparative criteria (not only exact criteria). In other words, I need to do something like this:

                $result = $purchases_repository->findBy(array("prize" => ">200"));
                

                这样我就可以购买所有奖励超过 200 的商品.

                so that I'd get all purchases where the prize is above 200.

                推荐答案

                这是一个使用 Expr() Class - 几天前我也需要这个,我花了一些时间才知道确切的语法是什么及使用方式:

                This is an example using the Expr() Class - I needed this too some days ago and it took me some time to find out what is the exact syntax and way of usage:

                /**
                 * fetches Products that are more expansive than the given price
                 * 
                 * @param int $price
                 * @return array
                 */
                public function findProductsExpensiveThan($price)
                {
                  $em = $this->getEntityManager();
                  $qb = $em->createQueryBuilder();
                
                  $q  = $qb->select(array('p'))
                           ->from('YourProductBundle:Product', 'p')
                           ->where(
                             $qb->expr()->gt('p.price', $price)
                           )
                           ->orderBy('p.price', 'DESC')
                           ->getQuery();
                
                  return $q->getResult();
                }
                

                这篇关于如何使用具有比较标准的 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 的问题)

                    <bdo id='7tSWn'></bdo><ul id='7tSWn'></ul>
                    <tfoot id='7tSWn'></tfoot>

                    1. <small id='7tSWn'></small><noframes id='7tSWn'>

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

                          <legend id='7tSWn'><style id='7tSWn'><dir id='7tSWn'><q id='7tSWn'></q></dir></style></legend>
                            <tbody id='7tSWn'></tbody>